diff options
author | hrs <hrs@FreeBSD.org> | 2011-06-16 12:24:02 +0000 |
---|---|---|
committer | hrs <hrs@FreeBSD.org> | 2011-06-16 12:24:02 +0000 |
commit | 7afd303ca9e45353e1af220a988ddac723fde355 (patch) | |
tree | 356c3cc3903b4ba969f103c2c6ccc21fc748bdaa /sys/kern/kern_exit.c | |
parent | b2a6f5600367e61c439c79db2317d4619960e2ce (diff) | |
parent | cc8fba8d7c933e32931cfc80150a2ed465e70825 (diff) | |
download | FreeBSD-src-7afd303ca9e45353e1af220a988ddac723fde355.zip FreeBSD-src-7afd303ca9e45353e1af220a988ddac723fde355.tar.gz |
Merge from HEAD@222977.
Diffstat (limited to 'sys/kern/kern_exit.c')
-rw-r--r-- | sys/kern/kern_exit.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index 6510e13..bb25d17 100644 --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -701,8 +701,9 @@ proc_reap(struct thread *td, struct proc *p, int *status, int options, */ if (p->p_oppid && (t = pfind(p->p_oppid)) != NULL) { PROC_LOCK(p); - p->p_oppid = 0; proc_reparent(p, t); + p->p_pptr->p_dbg_child--; + p->p_oppid = 0; PROC_UNLOCK(p); pksignal(t, SIGCHLD, p->p_ksi); wakeup(t); @@ -794,7 +795,8 @@ kern_wait(struct thread *td, pid_t pid, int *status, int options, pid = -q->p_pgid; PROC_UNLOCK(q); } - if (options &~ (WUNTRACED|WNOHANG|WCONTINUED|WNOWAIT|WLINUXCLONE)) + /* If we don't know the option, just return. */ + if (options & ~(WUNTRACED|WNOHANG|WCONTINUED|WNOWAIT|WLINUXCLONE)) return (EINVAL); loop: if (q->p_flag & P_STATCHILD) { @@ -873,7 +875,10 @@ loop: } if (nfound == 0) { sx_xunlock(&proctree_lock); - return (ECHILD); + if (td->td_proc->p_dbg_child) + return (0); + else + return (ECHILD); } if (options & WNOHANG) { sx_xunlock(&proctree_lock); |