From owner-svn-src-all@FreeBSD.ORG Mon Aug 4 19:02:30 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C1AE87D0 for ; Mon, 4 Aug 2014 19:02:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 92B7F2B20 for ; Mon, 4 Aug 2014 19:02:30 +0000 (UTC) Received: from markj (uid 1309) (envelope-from markj@FreeBSD.org) id 5093 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 04 Aug 2014 19:02:30 +0000 From: Mark Johnston Date: Mon, 4 Aug 2014 19:02:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269525 - head/sys/cddl/contrib/opensolaris/uts/common/dtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53dfd8c6.5093.750714e1@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2014 19:02:30 -0000 Author: markj Date: Mon Aug 4 19:02:30 2014 New Revision: 269525 URL: http://svnweb.freebsd.org/changeset/base/269525 Log: Return 0 for the PPID of threads in process 0, as process 0 doesn't have a parent process. MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Mon Aug 4 18:52:26 2014 (r269524) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Mon Aug 4 19:02:30 2014 (r269525) @@ -3415,7 +3415,10 @@ dtrace_dif_variable(dtrace_mstate_t *mst */ return ((uint64_t)curthread->t_procp->p_ppid); #else - return ((uint64_t)curproc->p_pptr->p_pid); + if (curproc->p_pid == proc0.p_pid) + return (curproc->p_pid); + else + return (curproc->p_pptr->p_pid); #endif case DIF_VAR_TID: