svn commit: r253325 - head/sys/kern
Konstantin Belousov
kib at FreeBSD.org
Sat Jul 13 19:32:51 UTC 2013
Author: kib
Date: Sat Jul 13 19:32:50 2013
New Revision: 253325
URL: http://svnweb.freebsd.org/changeset/base/253325
Log:
Allow to call clock_gettime() on the clock id for zombie process.
Reported by: Petr Salinger <Petr.Salinger at seznam.cz>
PR: threads/180496
Sponsored by: The FreeBSD Foundation
Modified:
head/sys/kern/kern_time.c
Modified: head/sys/kern/kern_time.c
==============================================================================
--- head/sys/kern/kern_time.c Sat Jul 13 18:09:42 2013 (r253324)
+++ head/sys/kern/kern_time.c Sat Jul 13 19:32:50 2013 (r253325)
@@ -297,14 +297,9 @@ get_cputime(struct thread *td, clockid_t
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);
}
More information about the svn-src-head
mailing list