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.salin...@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);
        }
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to