mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-20 08:44:33 +00:00
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
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=243528
|
@ -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…
Reference in a new issue