Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 Jan 2015 07:22:39 +0000 (UTC)
From:      Dmitry Chagin <dchagin@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r276906 - head/sys/kern
Message-ID:  <201501100722.t0A7MdCv072747@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



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