[BusyBox-cvs] busybox/init init.c,1.178,1.179

Erik Andersen andersen at codepoet.org
Tue Dec 17 09:48:20 UTC 2002


Update of /var/cvs/busybox/init
In directory winder:/tmp/cvs-serv24144/init

Modified Files:
	init.c 
Log Message:
Odd.  I never brought this forward from bb.stable.  Should handle
reaping child processes better.
 -Erik


Index: init.c
===================================================================
RCS file: /var/cvs/busybox/init/init.c,v
retrieving revision 1.178
retrieving revision 1.179
diff -u -d -r1.178 -r1.179
--- init.c	28 Nov 2002 09:40:36 -0000	1.178
+++ init.c	17 Dec 2002 09:48:16 -0000	1.179
@@ -1141,7 +1141,7 @@
 
 		/* Wait for a child process to exit */
 		wpid = wait(&status);
-		if (wpid > 0) {
+		while (wpid > 0) {
 			/* Find out who died and clean up their corpse */
 			for (a = init_action_list; a; a = a->next) {
 				if (a->pid == wpid) {
@@ -1152,6 +1152,8 @@
 							"Scheduling it for restart.\n", a->command, wpid);
 				}
 			}
+			/* see if anyone else is waiting to be reaped */
+			wpid = waitpid (-1, &status, WNOHANG);
 		}
 	}
 }




More information about the busybox-cvs mailing list