aboutsummaryrefslogtreecommitdiff
path: root/init/init.c
diff options
context:
space:
mode:
authorandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2003-07-26 06:25:12 +0000
committerandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2003-07-26 06:25:12 +0000
commit8be58e54c3916ec9624f487aef0ddc830430289e (patch)
treed3e31624a7ce8a5c4201503896f6efddb421bba9 /init/init.c
parent9ad568faf1f8c38776c57108a3727e73bd7614b5 (diff)
downloadbusybox-w32-8be58e54c3916ec9624f487aef0ddc830430289e.tar.gz
busybox-w32-8be58e54c3916ec9624f487aef0ddc830430289e.tar.bz2
busybox-w32-8be58e54c3916ec9624f487aef0ddc830430289e.zip
Patch from Thomas Gleixner to reap any zombie processes that are
reparented to init... git-svn-id: svn://busybox.net/trunk/busybox@7106 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'init/init.c')
-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... */