From da322e8d358c09c962756e773ba99796e5d3ee90 Mon Sep 17 00:00:00 2001 From: truckman Date: Wed, 11 Feb 2004 22:06:02 +0000 Subject: 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" --- sys/kern/sys_process.c | 1 + 1 file changed, 1 insertion(+) (limited to 'sys/kern/sys_process.c') diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index 9e49d9d..9a79551 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -561,6 +561,7 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data) PROC_UNLOCK(pp); PROC_LOCK(p); proc_reparent(p, pp); + p->p_sigparent = SIGCHLD; } p->p_flag &= ~(P_TRACED | P_WAITED); p->p_oppid = 0; -- cgit v1.1