Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Nov 2012 19:31:42 +0000 (UTC)
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r243528 - head/sys/kern
Message-ID:  <201211251931.qAPJVgSA015466@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pjd
Date: Sun Nov 25 19:31:42 2012
New Revision: 243528
URL: http://svnweb.freebsd.org/changeset/base/243528

Log:
  Look for zombie process only if we were given process id.
  
  Reviewed by:	kib
  MFC after:	2 weeks
  X-MFC-after-or-with:	243142

Modified:
  head/sys/kern/kern_proc.c

Modified: head/sys/kern/kern_proc.c
==============================================================================
--- head/sys/kern/kern_proc.c	Sun Nov 25 19:10:53 2012	(r243527)
+++ head/sys/kern/kern_proc.c	Sun Nov 25 19:31:42 2012	(r243528)
@@ -375,14 +375,15 @@ pget(pid_t pid, int flags, struct proc *
 	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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201211251931.qAPJVgSA015466>