svn commit: r276906 - head/sys/kern

Dmitry Chagin dchagin at FreeBSD.org
Sat Jan 10 07:22:39 UTC 2015


Author: dchagin
Date: Sat Jan 10 07:22:38 2015
New Revision: 276906
URL: https://svnweb.freebsd.org/changeset/base/276906

Log:
  Allow clock_getcpuclockid() on the CPU-time clock for zombie process.
  Posix does not prohibit this.
  
  Differential Revision:	https://reviews.freebsd.org/D1470
  
  Reviewed by:	kib
  MFC after:	1 week

Modified:
  head/sys/kern/kern_time.c

Modified: head/sys/kern/kern_time.c
==============================================================================
--- head/sys/kern/kern_time.c	Sat Jan 10 06:54:10 2015	(r276905)
+++ head/sys/kern/kern_time.c	Sat Jan 10 07:22:38 2015	(r276906)
@@ -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-all mailing list