Parcourir la source

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 il y a 25 ans
Parent
commit
aea1cf1826
2 fichiers modifiés avec 8 ajouts et 1 suppressions
  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>
 Tue Jul 24 19:07:43 CEST 2001 Wichert Akkerman <wakkerma@debian.org>
 
 
   * main/showpkg.c, main/query.h: new files
   * 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 */
 		dup(fd); /* stderr */
 	}
 	}
 	if (nicelevel) {
 	if (nicelevel) {
-		if (nice(nicelevel)==-1)
+		errno=0;
+		if ((nice(nicelevel)==-1) && (errno!=0))
 			fatal("Unable to alter nice level by %i: %s", nicelevel,
 			fatal("Unable to alter nice level by %i: %s", nicelevel,
 				strerror(errno));
 				strerror(errno));
 	}
 	}