diff options
author | julian <julian@FreeBSD.org> | 2002-06-30 20:13:53 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 2002-06-30 20:13:53 +0000 |
commit | cc3a647e1837c91ba17c1bddf50f4ef0b8020e46 (patch) | |
tree | a2480ba957b360b418b35b1c09fabe99851c8f86 /lib | |
parent | 3a003d229aa094d841df10015cab9632d69b3880 (diff) | |
download | FreeBSD-src-cc3a647e1837c91ba17c1bddf50f4ef0b8020e46.zip FreeBSD-src-cc3a647e1837c91ba17c1bddf50f4ef0b8020e46.tar.gz |
Don't even read in the thread if it is a zombie process.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libkvm/kvm_proc.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/libkvm/kvm_proc.c b/lib/libkvm/kvm_proc.c index 91e5216..d0e6517 100644 --- a/lib/libkvm/kvm_proc.c +++ b/lib/libkvm/kvm_proc.c @@ -130,11 +130,14 @@ kvm_proclist(kd, what, arg, p, bp, maxcnt) _kvm_err(kd, kd->program, "can't read proc at %x", p); return (-1); } - if (KREAD(kd, (u_long)TAILQ_FIRST(&proc.p_threads), - &mainthread)) { - _kvm_err(kd, kd->program, "can't read thread at %x", - TAILQ_FIRST(&proc.p_threads)); - return (-1); + if (proc.p_state != PRS_ZOMBIE) { + if (KREAD(kd, (u_long)TAILQ_FIRST(&proc.p_threads), + &mainthread)) { + _kvm_err(kd, kd->program, + "can't read thread at %x", + TAILQ_FIRST(&proc.p_threads)); + return (-1); + } } if (KREAD(kd, (u_long)proc.p_ucred, &ucred) == 0) { kp->ki_ruid = ucred.cr_ruid; @@ -268,7 +271,7 @@ kvm_proclist(kd, what, arg, p, bp, maxcnt) nopgrp: kp->ki_tdev = NODEV; } - if ((proc.p_state != PRS_ZOMBIE) && mainthread.td_wmesg) /* XXXKSE */ + if ((proc.p_state != PRS_ZOMBIE) && mainthread.td_wmesg) (void)kvm_read(kd, (u_long)mainthread.td_wmesg, kp->ki_wmesg, WMESGLEN); @@ -308,7 +311,7 @@ nopgrp: kp->ki_comm[MAXCOMLEN] = 0; } if ((proc.p_state != PRS_ZOMBIE) && - mainthread.td_blocked != 0) { + (mainthread.td_blocked != 0)) { kp->ki_kiflag |= KI_MTXBLOCK; if (mainthread.td_mtxname) (void)kvm_read(kd, |