Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.busybox.net/busybox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2003-07-26 10:25:12 +0400
committerEric Andersen <andersen@codepoet.org>2003-07-26 10:25:12 +0400
commitd5868c169214b2be273c8a5ecb0a30ff1368faba (patch)
treed3e31624a7ce8a5c4201503896f6efddb421bba9 /init
parentf231c72630e99c3b3d9eb867baef298a28e46f87 (diff)
Patch from Thomas Gleixner to reap any zombie processes that are
reparented to init...
Diffstat (limited 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)
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... */