summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortruckman <truckman@FreeBSD.org>2004-02-19 10:39:42 +0000
committertruckman <truckman@FreeBSD.org>2004-02-19 10:39:42 +0000
commit0dbd9a3b16f132e7511771e1ee508d097884a64c (patch)
treefd8bb1acc701b8b2ad20ea14400a3a96ad7014d3
parentab89ce797c28e5d26b40fb176973ff9775c1c895 (diff)
downloadFreeBSD-src-0dbd9a3b16f132e7511771e1ee508d097884a64c.zip
FreeBSD-src-0dbd9a3b16f132e7511771e1ee508d097884a64c.tar.gz
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
-rw-r--r--sys/kern/sys_process.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c
index 9a79551..7a0c02e 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;
OpenPOWER on IntegriCloud