From owner-svn-src-head@FreeBSD.ORG Sat Jul 13 19:32:51 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 808976BB; Sat, 13 Jul 2013 19:32:51 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 731641DC9; Sat, 13 Jul 2013 19:32:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6DJWp95011006; Sat, 13 Jul 2013 19:32:51 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6DJWpAS011005; Sat, 13 Jul 2013 19:32:51 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201307131932.r6DJWpAS011005@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 13 Jul 2013 19:32:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253325 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jul 2013 19:32:51 -0000 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 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); }