summaryrefslogtreecommitdiff
path: root/sys/compat/svr4/svr4_misc.c
diff options
context:
space:
mode:
authorJake Burkholder <jake@FreeBSD.org>2000-12-13 00:17:05 +0000
committerJake Burkholder <jake@FreeBSD.org>2000-12-13 00:17:05 +0000
commitc0c255709081ed31ff044179c49ca7e8c6abb162 (patch)
tree4dfd199ffaa97feec65c14b175f47ccddbeed914 /sys/compat/svr4/svr4_misc.c
parent1b3335af6a91bd501eacc94ea03d0f3221559b9b (diff)
Notes
Diffstat (limited to 'sys/compat/svr4/svr4_misc.c')
-rw-r--r--sys/compat/svr4/svr4_misc.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/compat/svr4/svr4_misc.c b/sys/compat/svr4/svr4_misc.c
index 4d921b56c045..601d205905e1 100644
--- a/sys/compat/svr4/svr4_misc.c
+++ b/sys/compat/svr4/svr4_misc.c
@@ -953,16 +953,19 @@ svr4_pfind(pid)
{
struct proc *p;
+ ALLPROC_LOCK(AP_SHARED);
/* look in the live processes */
if ((p = pfind(pid)) != NULL)
- return p;
+ goto out;
/* look in the zombies */
for (p = zombproc.lh_first; p != 0; p = p->p_list.le_next)
if (p->p_pid == pid)
- return p;
+ break;
+out:
+ ALLPROC_LOCK(AP_RELEASE);
- return NULL;
+ return p;
}
@@ -1253,7 +1256,9 @@ loop:
*/
leavepgrp(q);
+ ALLPROC_LOCK(AP_EXCLUSIVE);
LIST_REMOVE(q, p_list); /* off zombproc */
+ ALLPROC_LOCK(AP_RELEASE);
LIST_REMOVE(q, p_sibling);