diff options
author | julian <julian@FreeBSD.org> | 2002-06-30 17:06:46 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 2002-06-30 17:06:46 +0000 |
commit | 812b8c776264e1fd7df297f7ad8de0fcfe6aa309 (patch) | |
tree | 4814255c82f03b3850f7a9b1dffd3b5319dd2e3b /lib | |
parent | 064b0ce2e7f2b3b791f13cc761cfa097ccd40ecc (diff) | |
download | FreeBSD-src-812b8c776264e1fd7df297f7ad8de0fcfe6aa309.zip FreeBSD-src-812b8c776264e1fd7df297f7ad8de0fcfe6aa309.tar.gz |
grow a brain and do this right.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libkvm/kvm_proc.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/libkvm/kvm_proc.c b/lib/libkvm/kvm_proc.c index 5bc1867..91e5216 100644 --- a/lib/libkvm/kvm_proc.c +++ b/lib/libkvm/kvm_proc.c @@ -268,7 +268,7 @@ kvm_proclist(kd, what, arg, p, bp, maxcnt) nopgrp: kp->ki_tdev = NODEV; } - if (mainthread && mainthread.td_wmesg) /* XXXKSE */ + if ((proc.p_state != PRS_ZOMBIE) && mainthread.td_wmesg) /* XXXKSE */ (void)kvm_read(kd, (u_long)mainthread.td_wmesg, kp->ki_wmesg, WMESGLEN); @@ -307,10 +307,12 @@ nopgrp: strncpy(kp->ki_comm, proc.p_comm, MAXCOMLEN); kp->ki_comm[MAXCOMLEN] = 0; } - if (mainthread && mainthread.td_blocked != 0) { /* XXXKSE */ + if ((proc.p_state != PRS_ZOMBIE) && + mainthread.td_blocked != 0) { kp->ki_kiflag |= KI_MTXBLOCK; - if (mainthread.td_mtxname) /* XXXKSE */ - (void)kvm_read(kd, (u_long)mainthread.td_mtxname, + if (mainthread.td_mtxname) + (void)kvm_read(kd, + (u_long)mainthread.td_mtxname, kp->ki_mtxname, MTXNAMELEN); kp->ki_mtxname[MTXNAMELEN] = 0; } @@ -321,7 +323,7 @@ nopgrp: kp->ki_sigmask = proc.p_sigmask; kp->ki_xstat = proc.p_xstat; kp->ki_acflag = proc.p_acflag; - if (mainthread) { + if (proc.p_state != PRS_ZOMBIE) { kp->ki_pctcpu = proc.p_kse.ke_pctcpu; kp->ki_estcpu = proc.p_ksegrp.kg_estcpu; kp->ki_slptime = proc.p_kse.ke_slptime; |