[BusyBox-cvs] busybox/init init.c,1.190,1.191

Erik Andersen andersen at busybox.net
Sat Jul 26 06:24:29 UTC 2003


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

Modified Files:
	init.c 
Log Message:
Patch from Thomas Gleixner to reap any zombie processes that are 
reparented to init...


Index: init.c
===================================================================
RCS file: /var/cvs/busybox/init/init.c,v
retrieving revision 1.190
retrieving revision 1.191
diff -u -d -r1.190 -r1.191
--- init.c	22 Jul 2003 09:48:56 -0000	1.190
+++ init.c	26 Jul 2003 06:24:25 -0000	1.191
@@ -825,6 +825,13 @@
 	got_cont = 1;
 }
 
+/* Reap any zombie processes that are reparented to init */
+static void child_handler(int sig)
+{
+	int status;
+	while ( wait3(&status, WNOHANG, NULL) > 0 );
+}
+
 #endif							/* ! DEBUG_INIT */
 
 static void new_init_action(int action, char *command, const char *cons)
@@ -1065,6 +1072,7 @@
 	signal(SIGCONT, cont_handler);
 	signal(SIGSTOP, stop_handler);
 	signal(SIGTSTP, stop_handler);
+	signal(SIGCHLD, child_handler);
 
 	/* Turn off rebooting via CTL-ALT-DEL -- we get a 
 	 * SIGINT on CAD so we can shut things down gracefully... */




More information about the busybox-cvs mailing list