From af01cd2f746d8644675cf6c17c20542c2659e12f Mon Sep 17 00:00:00 2001 From: dchagin Date: Sat, 17 Jan 2015 06:18:45 +0000 Subject: [PATCH] MFC r276906: Allow clock_getcpuclockid() on the CPU-time clock for zombie process. Posix does not prohibit this. --- sys/kern/kern_time.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c index e8430e4b602d..80264da83214 100644 --- a/sys/kern/kern_time.c +++ b/sys/kern/kern_time.c @@ -200,13 +200,10 @@ kern_clock_getcpuclockid2(struct thread *td, id_t id, int which, 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;