diff options
author | des <des@FreeBSD.org> | 2000-11-06 03:23:56 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2000-11-06 03:23:56 +0000 |
commit | eed51b49c847bec22051f473ba7b3167f3a2bfc1 (patch) | |
tree | 2f6cec38216a0696334f01346162359154f36b50 /sys/i386/linux | |
parent | 29f311506104c5e95a751af932fc80956cb59757 (diff) | |
download | FreeBSD-src-eed51b49c847bec22051f473ba7b3167f3a2bfc1.zip FreeBSD-src-eed51b49c847bec22051f473ba7b3167f3a2bfc1.tar.gz |
Check that p->p_pptr is not NULL - kernel processes have no parents!
Diffstat (limited to 'sys/i386/linux')
-rw-r--r-- | sys/i386/linux/linprocfs/linprocfs_misc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/i386/linux/linprocfs/linprocfs_misc.c b/sys/i386/linux/linprocfs/linprocfs_misc.c index b985916..d799fe4 100644 --- a/sys/i386/linux/linprocfs/linprocfs_misc.c +++ b/sys/i386/linux/linprocfs/linprocfs_misc.c @@ -349,7 +349,7 @@ linprocfs_doprocstat(curp, p, pfs, uio) #define PS_ADD(name, fmt, arg) ps += sprintf(ps, " " fmt, arg) PS_ADD("comm", "(%s)", p->p_comm); PS_ADD("statr", "%c", '0'); /* XXX */ - PS_ADD("ppid", "%d", p->p_pptr->p_pid); + PS_ADD("ppid", "%d", p->p_pptr ? p->p_pptr->p_pid : 0); PS_ADD("pgrp", "%d", p->p_pgid); PS_ADD("session", "%d", p->p_session->s_sid); PS_ADD("tty", "%d", 0); /* XXX */ @@ -432,7 +432,7 @@ linprocfs_doprocstatus(curp, p, pfs, uio) * Credentials */ PS_ADD(ps, "Pid:\t%d\n", p->p_pid); - PS_ADD(ps, "PPid:\t%d\n", p->p_pptr->p_pid); + PS_ADD(ps, "PPid:\t%d\n", p->p_pptr ? p->p_pptr->p_pid : 0); PS_ADD(ps, "Uid:\t%d %d %d %d\n", p->p_cred->p_ruid, p->p_ucred->cr_uid, p->p_cred->p_svuid, |