diff options
author | kib <kib@FreeBSD.org> | 2013-07-13 19:32:50 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2013-07-13 19:32:50 +0000 |
commit | 66a95162d6f493f1f4481d7f0225a1ad87b5db93 (patch) | |
tree | e055fe32e1ded98a57f7d15496cc6abb162437d5 | |
parent | c60dcc15f195c5b61b24626d4fbbdfc3d8c0e722 (diff) | |
download | FreeBSD-src-66a95162d6f493f1f4481d7f0225a1ad87b5db93.zip FreeBSD-src-66a95162d6f493f1f4481d7f0225a1ad87b5db93.tar.gz |
Allow to call clock_gettime() on the clock id for zombie process.
Reported by: Petr Salinger <Petr.Salinger@seznam.cz>
PR: threads/180496
Sponsored by: The FreeBSD Foundation
-rw-r--r-- | sys/kern/kern_time.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c index b68c949..9e0cc06 100644 --- a/sys/kern/kern_time.c +++ b/sys/kern/kern_time.c @@ -297,14 +297,9 @@ get_cputime(struct thread *td, clockid_t clock_id, struct timespec *ats) PROC_UNLOCK(td2->td_proc); } else { pid = clock_id & CPUCLOCK_ID_MASK; - p2 = pfind(pid); - if (p2 == NULL) - return (EINVAL); - error = p_cansee(td, p2); - if (error) { - PROC_UNLOCK(p2); + error = pget(pid, PGET_CANSEE, &p2); + if (error != 0) return (EINVAL); - } get_process_cputime(p2, ats); PROC_UNLOCK(p2); } |