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:
Pawel Jakub Dawidek 2012-11-25 19:31:42 +00:00
parent 2462328ee0
commit 4f66641749
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=243528

View file

@ -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);