Date: Sat, 13 Jul 2013 19:32:51 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253325 - head/sys/kern Message-ID: <201307131932.r6DJWpAS011005@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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@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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201307131932.r6DJWpAS011005>