From: Eric Leblond Date: Sat, 29 Nov 2008 14:10:25 +0000 (+0100) Subject: Treat nice function return. X-Git-Tag: ulogd-2.0.0beta3~34 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a2f317e7d764f54bc51d3962ed1761358bfa10d9;p=thirdparty%2Fulogd2.git Treat nice function return. gcc was warning that the return of the nice function should be treated. This patch adds an error message in case of failure. --- diff --git a/src/ulogd.c b/src/ulogd.c index e69079d..ead35b5 100644 --- a/src/ulogd.c +++ b/src/ulogd.c @@ -1129,7 +1129,13 @@ int main(int argc, char* argv[]) } } - nice(-1); + errno = 0; + if (nice(-1) == -1) { + if (errno != 0) + ulogd_log(ULOGD_ERROR, "Could not nice process: %s\n", + strerror(errno)); + } + if (daemonize){ if (fork()) {