From aec1bace621b2fdbe4e0ed9d34094fe5322edbf3 Mon Sep 17 00:00:00 2001 From: pjd Date: Sun, 25 Nov 2012 19:31:42 +0000 Subject: [PATCH] Look for zombie process only if we were given process id. Reviewed by: kib MFC after: 2 weeks X-MFC-after-or-with: 243142 --- sys/kern/kern_proc.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index 0ab55681ad2..2a74a593cff 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); -- 2.45.2