From ca1647767f188f09ab7e3ad9b6260e98f6af9151 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Tue, 6 May 2025 15:25:39 -0400 Subject: stop trying to print warnings if we have no stderr due to daemonize() --- marsond.c | 6 ++++-- 1 file 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)); } } -- cgit v1.2.3