Look for zombie process only if we were given process id.
Reviewed by: kib MFC after: 2 weeks X-MFC-after-or-with: 243142
This commit is contained in:
parent
2462328ee0
commit
4f66641749
@ -375,14 +375,15 @@ pget(pid_t pid, int flags, struct proc **pp)
|
||||
int error;
|
||||
|
||||
sx_slock(&allproc_lock);
|
||||
if (pid <= PID_MAX)
|
||||
if (pid <= PID_MAX) {
|
||||
p = pfind_locked(pid);
|
||||
else if ((flags & PGET_NOTID) == 0)
|
||||
if (p == NULL && (flags & PGET_NOTWEXIT) == 0)
|
||||
p = zpfind_locked(pid);
|
||||
} else if ((flags & PGET_NOTID) == 0) {
|
||||
p = pfind_tid_locked(pid);
|
||||
else
|
||||
} else {
|
||||
p = NULL;
|
||||
if (p == NULL && (flags & PGET_NOTWEXIT) == 0)
|
||||
p = zpfind_locked(pid);
|
||||
}
|
||||
sx_sunlock(&allproc_lock);
|
||||
if (p == NULL)
|
||||
return (ESRCH);
|
||||
|
Loading…
x
Reference in New Issue
Block a user