Date: Mon, 4 Aug 2014 19:02:30 +0000 (UTC) From: Mark Johnston <markj@FreeBSD.org> 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 Message-ID: <53dfd8c6.5093.750714e1@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?53dfd8c6.5093.750714e1>