svn commit: r277287 - stable/10/sys/kern

Dmitry Chagin dchagin at FreeBSD.org
Sat Jan 17 06:18:46 UTC 2015


Author: dchagin
Date: Sat Jan 17 06:18:45 2015
New Revision: 277287
URL: https://svnweb.freebsd.org/changeset/base/277287

Log:
  MFC r276906:
  
  Allow clock_getcpuclockid() on the CPU-time clock for zombie process.
  Posix does not prohibit this.

Modified:
  stable/10/sys/kern/kern_time.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/kern/kern_time.c
==============================================================================
--- stable/10/sys/kern/kern_time.c	Sat Jan 17 06:17:54 2015	(r277286)
+++ stable/10/sys/kern/kern_time.c	Sat Jan 17 06:18:45 2015	(r277287)
@@ -200,13 +200,10 @@ kern_clock_getcpuclockid2(struct thread 
 	switch (which) {
 	case CPUCLOCK_WHICH_PID:
 		if (id != 0) {
-			p = pfind(id);
-			if (p == NULL)
-				return (ESRCH);
-			error = p_cansee(td, p);
-			PROC_UNLOCK(p);
+			error = pget(id, PGET_CANSEE | PGET_NOTID, &p);
 			if (error != 0)
 				return (error);
+			PROC_UNLOCK(p);
 			pid = id;
 		} else {
 			pid = td->td_proc->p_pid;


More information about the svn-src-stable-10 mailing list