Pārlūkot izejas kodu

seems glibc has a completely non-standard return value for nice(2), so deal with that properly now so things also work on non-glibc systems

Wichert Akkerman 25 gadi atpakaļ
vecāks
revīzija
aea1cf1826
2 mainītis faili ar 8 papildinājumiem un 1 dzēšanām
  1. 6 0
      ChangeLog
  2. 2 1
      utils/start-stop-daemon.c

+ 6 - 0
ChangeLog

@@ -1,3 +1,9 @@
+Thu Jul 26 13:52:43 CEST 2001 Wichert Akkerman <wakkerma@debian.org>
+
+  * utils/start-stop-daemon.c: seems glibc has a completely non-standard
+    return value for nice(2), so deal with that properly now so things also
+    work on non-glibc systems.
+
 Tue Jul 24 19:07:43 CEST 2001 Wichert Akkerman <wakkerma@debian.org>
 
   * main/showpkg.c, main/query.h: new files

+ 2 - 1
utils/start-stop-daemon.c

@@ -1151,7 +1151,8 @@ main(int argc, char **argv)
 		dup(fd); /* stderr */
 	}
 	if (nicelevel) {
-		if (nice(nicelevel)==-1)
+		errno=0;
+		if ((nice(nicelevel)==-1) && (errno!=0))
 			fatal("Unable to alter nice level by %i: %s", nicelevel,
 				strerror(errno));
 	}