summaryrefslogtreecommitdiffstats
path: root/sys/kern/sys_process.c
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2012-02-23 11:50:23 +0000
committerkib <kib@FreeBSD.org>2012-02-23 11:50:23 +0000
commitbfe47eb1dfe2cde280e0f7b11cb1484279fbaebb (patch)
treefb47dc9ca6fb0dd24b069fa753000091678e0d4f /sys/kern/sys_process.c
parent8c1fe31ca0fbbfe3c1c3e8d76f0d26dc0135e04a (diff)
downloadFreeBSD-src-bfe47eb1dfe2cde280e0f7b11cb1484279fbaebb.zip
FreeBSD-src-bfe47eb1dfe2cde280e0f7b11cb1484279fbaebb.tar.gz
Allow the parent to gather the exit status of the children reparented
to the debugger. When reparenting for debugging, keep the child in the new orphan list of old parent. When looping over the children in kern_wait(), iterate over both children list and orphan list to search for the process by pid. Submitted by: Dmitry Mikulin <dmitrym juniper.net> MFC after: 2 weeks
Diffstat (limited to 'sys/kern/sys_process.c')
-rw-r--r--sys/kern/sys_process.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c
index 2060efe..9c6c204 100644
--- a/sys/kern/sys_process.c
+++ b/sys/kern/sys_process.c
@@ -841,8 +841,6 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data)
p->p_flag |= P_TRACED;
p->p_oppid = p->p_pptr->p_pid;
if (p->p_pptr != td->td_proc) {
- /* Remember that a child is being debugged(traced). */
- p->p_pptr->p_dbg_child++;
proc_reparent(p, td->td_proc);
}
data = SIGSTOP;
@@ -931,7 +929,6 @@ 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_pptr->p_dbg_child--;
if (pp == initproc)
p->p_sigparent = SIGCHLD;
}
OpenPOWER on IntegriCloud