]> git.ipfire.org Git - thirdparty/ulogd2.git/commitdiff
Treat nice function return.
authorEric Leblond <eric@inl.fr>
Sat, 29 Nov 2008 14:10:25 +0000 (15:10 +0100)
committerEric Leblond <eric@inl.fr>
Tue, 9 Dec 2008 00:19:25 +0000 (01:19 +0100)
gcc was warning that the return of the nice function should
be treated. This patch adds an error message in case of failure.

src/ulogd.c

index e69079d6483f1c39a2f1428435301abdf7f2a2c7..ead35b546cd235cb8de6d7cd0bb027ec32c6df4c 100644 (file)
@@ -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()) {