Don't remove queued SIGCHLD if options contain WNOWAIT, so other

threads still can be notified by the signal.
This commit is contained in:
davidxu 2008-08-29 01:34:05 +00:00
parent dbe9aeaa21
commit b08de3bf2f

View File

@ -737,12 +737,6 @@ loop:
td->td_retval[0] = p->p_pid;
if (status)
*status = p->p_xstat; /* convert to int */
PROC_LOCK(q);
sigqueue_take(p->p_ksi);
PROC_UNLOCK(q);
PROC_UNLOCK(p);
if (options & WNOWAIT) {
/*
@ -750,10 +744,16 @@ loop:
* Caller does not wish to release the proc
* struct just yet.
*/
PROC_UNLOCK(p);
sx_xunlock(&proctree_lock);
return (0);
}
PROC_LOCK(q);
sigqueue_take(p->p_ksi);
PROC_UNLOCK(q);
PROC_UNLOCK(p);
/*
* If we got the child via a ptrace 'attach',
* we need to give it back to the old parent.