1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-04 09:09:56 +00:00

Don't even read in the thread if it is a zombie process.

This commit is contained in:
Julian Elischer 2002-06-30 20:13:53 +00:00
parent eb538bfd64
commit 58551c0393
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=99157

View File

@ -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 @@ kvm_proclist(kd, what, arg, p, bp, maxcnt)
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,