From cf93aa166c9adbdfe92d0c66119ef3a153eed2d4 Mon Sep 17 00:00:00 2001 From: Don Lewis Date: Thu, 19 Feb 2004 10:39:42 +0000 Subject: [PATCH] When reparenting a process in the PT_DETACH code, only set p_sigparent to SIGCHLD if the new parent process is initproc. MFC after: 2 weeks --- sys/kern/sys_process.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index 9a79551ed98..7a0c02ea01e 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -561,7 +561,8 @@ 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; + if (pp == initproc) + p->p_sigparent = SIGCHLD; } p->p_flag &= ~(P_TRACED | P_WAITED); p->p_oppid = 0;