Once in a month, when the moon is full, killall mistakenly considers

living process as a zombie and refuses to kill it. The cause is that
the code masks ki_stat with SZOMB to compare with SZOMB, but ki_stat
is not a mask.

Possibly reported by:	cperciva
MFC after:	3 days
This commit is contained in:
kib 2012-06-30 16:36:22 +00:00
parent 80eade56fc
commit 5199a9a8a6

View File

@ -319,7 +319,7 @@ main(int ac, char **av)
mypid = getpid();
for (i = 0; i < nprocs; i++) {
if ((procs[i].ki_stat & SZOMB) == SZOMB && !zflag)
if (procs[i].ki_stat == SZOMB && !zflag)
continue;
thispid = procs[i].ki_pid;
strlcpy(thiscmd, procs[i].ki_comm, sizeof(thiscmd));