aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2025-05-06 15:25:39 -0400
committerB. Watson <urchlay@slackware.uk>2025-05-06 15:25:39 -0400
commitca1647767f188f09ab7e3ad9b6260e98f6af9151 (patch)
tree2cb784a494cc899de714f70e094a58155e696e00
parent9df059293d7743fbc1d51685faf45c384adbda85 (diff)
downloadmarsond-ca1647767f188f09ab7e3ad9b6260e98f6af9151.tar.gz
stop trying to print warnings if we have no stderr due to daemonize()
-rw-r--r--marsond.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/marsond.c b/marsond.c
index b94883b..00ac139 100644
--- a/marsond.c
+++ b/marsond.c
@@ -112,7 +112,8 @@ void lock_memory(void) {
if(mlockall(MCL_CURRENT) >= 0) {
debug("mlockall() succeeded");
} else {
- warn("can't lock memory: %s", strerror(errno));
+ if(foreground)
+ warn("can't lock memory: %s", strerror(errno));
}
}
@@ -122,7 +123,8 @@ void set_realtime(void) {
if(setpriority(PRIO_PROCESS, 0, -20) >= 0) {
debug("setpriority() succeeded");
} else {
- warn("can't setpriority(): %s", strerror(errno));
+ if(foreground)
+ warn("can't setpriority(): %s", strerror(errno));
}
}