diff options
author | kib <kib@FreeBSD.org> | 2009-04-20 14:34:55 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2009-04-20 14:34:55 +0000 |
commit | 32441d8ae9e5b1339f6279b54e943467f1fe6194 (patch) | |
tree | 9e046ba96bea2fcf8ce6e6fd7ed0a89f4803389f /sys/kern/kern_exit.c | |
parent | 03099c894029373bb9e526cd36df8165210edeaa (diff) | |
download | FreeBSD-src-32441d8ae9e5b1339f6279b54e943467f1fe6194.zip FreeBSD-src-32441d8ae9e5b1339f6279b54e943467f1fe6194.tar.gz |
On the exit of the child process which parent either set SA_NOCLDWAIT
or ignored SIGCHLD, unconditionally wake up the parent instead of doing
this only when the child is a last child.
This brings us in line with other U**xes that support SA_NOCLDWAIT. If
the parent called waitpid(childpid), then exit of the child should wake
up the parent immediately instead of forcing it to wait for all children
to exit.
Reported by: Alan Ferrency <alan pair com>
Submitted by: Jilles Tjoelker <jilles stack nl>
PR: 108390
MFC after: 2 weeks
Diffstat (limited to 'sys/kern/kern_exit.c')
-rw-r--r-- | sys/kern/kern_exit.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index 4255734..c35c6f2 100644 --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -504,13 +504,13 @@ exit1(struct thread *td, int rv) proc_reparent(p, initproc); p->p_sigparent = SIGCHLD; PROC_LOCK(p->p_pptr); + /* - * If this was the last child of our parent, notify - * parent, so in case he was wait(2)ing, he will + * Notify parent, so in case he was wait(2)ing or + * executiing waitpid(2) with our pid, he will * continue. */ - if (LIST_EMPTY(&pp->p_children)) - wakeup(pp); + wakeup(pp); } else mtx_unlock(&p->p_pptr->p_sigacts->ps_mtx); |