diff options
Diffstat (limited to 'sys/kern/p1003_1b.c')
-rw-r--r-- | sys/kern/p1003_1b.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/kern/p1003_1b.c b/sys/kern/p1003_1b.c index 860176a..0d1fd0e 100644 --- a/sys/kern/p1003_1b.c +++ b/sys/kern/p1003_1b.c @@ -87,9 +87,10 @@ int p31b_proc(struct proc *p, pid_t pid, struct proc **pp) int ret = 0; struct proc *other_proc = 0; - if (pid == 0) + if (pid == 0) { other_proc = p; - else + PROC_LOCK(p); + } else other_proc = pfind(pid); if (other_proc) @@ -100,6 +101,7 @@ int p31b_proc(struct proc *p, pid_t pid, struct proc **pp) *pp = other_proc; else ret = EPERM; + PROC_UNLOCK(other_proc); } else ret = ESRCH; |