summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_exit.c7
-rw-r--r--sys/kern/kern_fork.c8
2 files changed, 7 insertions, 8 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
index a23a4aaac57..245e6c62015 100644
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_exit.c,v 1.15 1999/02/26 05:06:34 art Exp $ */
+/* $OpenBSD: kern_exit.c,v 1.16 1999/03/02 22:19:09 niklas Exp $ */
/* $NetBSD: kern_exit.c,v 1.39 1996/04/22 01:38:25 christos Exp $ */
/*
@@ -335,9 +335,10 @@ sys_wait4(q, v, retval)
loop:
nfound = 0;
for (p = q->p_children.lh_first; p != 0; p = p->p_sibling.le_next) {
- if (SCARG(uap, pid) != WAIT_ANY &&
+ if ((p->p_flag & P_NOZOMBIE) ||
+ (SCARG(uap, pid) != WAIT_ANY &&
p->p_pid != SCARG(uap, pid) &&
- p->p_pgid != -SCARG(uap, pid))
+ p->p_pgid != -SCARG(uap, pid)))
continue;
nfound++;
if (p->p_stat == SZOMB) {
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c
index 3b5260699ce..55cf72ce782 100644
--- a/sys/kern/kern_fork.c
+++ b/sys/kern/kern_fork.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_fork.c,v 1.18 1999/02/26 04:59:39 art Exp $ */
+/* $OpenBSD: kern_fork.c,v 1.19 1999/03/02 22:19:08 niklas Exp $ */
/* $NetBSD: kern_fork.c,v 1.29 1996/02/09 18:59:34 christos Exp $ */
/*
@@ -280,11 +280,9 @@ again:
p2->p_flag |= P_PPWAIT;
LIST_INSERT_AFTER(p1, p2, p_pglist);
p2->p_pptr = p1;
- if (forktype == ISRFORK && (rforkflags & RFNOWAIT)) {
+ if (forktype == ISRFORK && (rforkflags & RFNOWAIT))
p2->p_flag |= P_NOZOMBIE;
- } else {
- LIST_INSERT_HEAD(&p1->p_children, p2, p_sibling);
- }
+ LIST_INSERT_HEAD(&p1->p_children, p2, p_sibling);
LIST_INIT(&p2->p_children);
#ifdef KTRACE