aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2003-07-26 06:25:12 +0000
committerEric Andersen <andersen@codepoet.org>2003-07-26 06:25:12 +0000
commitd5868c169214b2be273c8a5ecb0a30ff1368faba (patch)
treed3e31624a7ce8a5c4201503896f6efddb421bba9
parentf231c72630e99c3b3d9eb867baef298a28e46f87 (diff)
downloadbusybox-w32-d5868c169214b2be273c8a5ecb0a30ff1368faba.tar.gz
busybox-w32-d5868c169214b2be273c8a5ecb0a30ff1368faba.tar.bz2
busybox-w32-d5868c169214b2be273c8a5ecb0a30ff1368faba.zip
Patch from Thomas Gleixner to reap any zombie processes that are
reparented to init...
-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... */