aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/kern_exit.c
diff options
context:
space:
mode:
authorDon Lewis <truckman@FreeBSD.org>2004-02-11 22:06:02 +0000
committerDon Lewis <truckman@FreeBSD.org>2004-02-11 22:06:02 +0000
commit55b5f2a20289e2d06935a4898534e0b51d5b7b5f (patch)
treedb4610925d7da7c9256ffa824a06f8065b7f03ff /sys/kern/kern_exit.c
parent40d387429fd29b705070de2a44339888b0fdc7fd (diff)
downloadsrc-55b5f2a20289e2d06935a4898534e0b51d5b7b5f.tar.gz
src-55b5f2a20289e2d06935a4898534e0b51d5b7b5f.zip
When reparenting a process to init, make sure that p_sigparent is
set to SIGCHLD. This avoids the creation of orphaned Linux-threaded zombies that init is unable to reap. This can occur when the parent process sets its SIGCHLD to SIG_IGN. Fix a similar situation in the PT_DETACH code. Tested by: "Steven Hartland" <killing AT multiplay.co.uk>
Notes
Notes: svn path=/head/; revision=125720
Diffstat (limited to 'sys/kern/kern_exit.c')
-rw-r--r--sys/kern/kern_exit.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
index f332e6bf6744..419c4b2e9217 100644
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -458,6 +458,7 @@ exit1(struct thread *td, int rv)
pp = p->p_pptr;
PROC_UNLOCK(pp);
proc_reparent(p, initproc);
+ p->p_sigparent = SIGCHLD;
PROC_LOCK(p->p_pptr);
/*
* If this was the last child of our parent, notify