summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_proc.c
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2012-11-25 19:31:42 +0000
committerpjd <pjd@FreeBSD.org>2012-11-25 19:31:42 +0000
commitaec1bace621b2fdbe4e0ed9d34094fe5322edbf3 (patch)
treee0a8d234527a0580d53ae587eb51f06b84cb3717 /sys/kern/kern_proc.c
parentf9c87e23be86a125450ef70018f950e3ac702282 (diff)
downloadFreeBSD-src-aec1bace621b2fdbe4e0ed9d34094fe5322edbf3.zip
FreeBSD-src-aec1bace621b2fdbe4e0ed9d34094fe5322edbf3.tar.gz
Look for zombie process only if we were given process id.
Reviewed by: kib MFC after: 2 weeks X-MFC-after-or-with: 243142
Diffstat (limited to 'sys/kern/kern_proc.c')
-rw-r--r--sys/kern/kern_proc.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c
index 0ab5568..2a74a59 100644
--- a/sys/kern/kern_proc.c
+++ b/sys/kern/kern_proc.c
@@ -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);
OpenPOWER on IntegriCloud