svn commit: r277286 - stable/9/sys/kern

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


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

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

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

Modified: stable/9/sys/kern/kern_time.c
==============================================================================
--- stable/9/sys/kern/kern_time.c	Sat Jan 17 02:17:59 2015	(r277285)
+++ stable/9/sys/kern/kern_time.c	Sat Jan 17 06:17:54 2015	(r277286)
@@ -199,13 +199,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-all mailing list