diff src/util.c @ 3891:a611ec77d1d2

[gaim-migrate @ 4043] this is a better test condition from paco-paco. (17:05:42) Paco-Paco: and you have to check the return value of wait against (pid_t)-1 (17:05:42) Paco-Paco: you *cannot* use < 0 (17:05:45) Paco-Paco: pid_t is unsigned on some systems :-) (17:05:57) Paco-Paco: actually, my patch might need fixed for the while loop (17:05:58) ***Paco-Paco looks (17:07:16) Paco-Paco: LSchiere: actually, I have a one-line fix committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Sun, 03 Nov 2002 22:16:39 +0000
parents 271ca53950e6
children fcc6db86f5c7
line wrap: on
line diff
--- a/src/util.c	Sun Nov 03 21:59:05 2002 +0000
+++ b/src/util.c	Sun Nov 03 22:16:39 2002 +0000
@@ -650,7 +650,7 @@
 
 	do {
 		pid = waitpid(-1, &status, WNOHANG);
-	} while (pid > 0);
+	} while (pid != 0 && pid != (pid_t)-1);
 	if(pid == (pid_t)-1 && errno != ECHILD) {
 		char errmsg[BUFSIZ];
 		sprintf(errmsg, "Warning: waitpid() returned %d", pid);