diff options
author | B. Watson <urchlay@slackware.uk> | 2025-05-06 15:25:39 -0400 |
---|---|---|
committer | B. Watson <urchlay@slackware.uk> | 2025-05-06 15:25:39 -0400 |
commit | ca1647767f188f09ab7e3ad9b6260e98f6af9151 (patch) | |
tree | 2cb784a494cc899de714f70e094a58155e696e00 | |
parent | 9df059293d7743fbc1d51685faf45c384adbda85 (diff) | |
download | marsond-ca1647767f188f09ab7e3ad9b6260e98f6af9151.tar.gz |
stop trying to print warnings if we have no stderr due to daemonize()
-rw-r--r-- | marsond.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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)); } } |