Patch from Thomas Gleixner to reap any zombie processes that are
authorEric Andersen <andersen@codepoet.org>
Sat, 26 Jul 2003 06:25:12 +0000 (06:25 -0000)
committerEric Andersen <andersen@codepoet.org>
Sat, 26 Jul 2003 06:25:12 +0000 (06:25 -0000)
reparented to init...

init/init.c

index 657bad6cd52c150c9771ea7e84718d8ac8f8ede5..7e24eacdddc0665e368cfb630feaf109739a80b9 100644 (file)
@@ -825,6 +825,13 @@ static void cont_handler(int sig)
        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 @@ extern int init_main(int argc, char **argv)
        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... */