aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--init/init.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/init/init.c b/init/init.c
index 657bad6cd..7e24eacdd 100644
--- a/init/init.c
+++ b/init/init.c
@@ -825,6 +825,13 @@ static void cont_handler(int sig)
825 got_cont = 1; 825 got_cont = 1;
826} 826}
827 827
828/* Reap any zombie processes that are reparented to init */
829static void child_handler(int sig)
830{
831 int status;
832 while ( wait3(&status, WNOHANG, NULL) > 0 );
833}
834
828#endif /* ! DEBUG_INIT */ 835#endif /* ! DEBUG_INIT */
829 836
830static void new_init_action(int action, char *command, const char *cons) 837static void new_init_action(int action, char *command, const char *cons)
@@ -1065,6 +1072,7 @@ extern int init_main(int argc, char **argv)
1065 signal(SIGCONT, cont_handler); 1072 signal(SIGCONT, cont_handler);
1066 signal(SIGSTOP, stop_handler); 1073 signal(SIGSTOP, stop_handler);
1067 signal(SIGTSTP, stop_handler); 1074 signal(SIGTSTP, stop_handler);
1075 signal(SIGCHLD, child_handler);
1068 1076
1069 /* Turn off rebooting via CTL-ALT-DEL -- we get a 1077 /* Turn off rebooting via CTL-ALT-DEL -- we get a
1070 * SIGINT on CAD so we can shut things down gracefully... */ 1078 * SIGINT on CAD so we can shut things down gracefully... */