Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 30 Jun 2012 16:36:23 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r237847 - head/usr.bin/killall
Message-ID:  <201206301636.q5UGaNCB029813@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Sat Jun 30 16:36:22 2012
New Revision: 237847
URL: http://svn.freebsd.org/changeset/base/237847

Log:
  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

Modified:
  head/usr.bin/killall/killall.c

Modified: head/usr.bin/killall/killall.c
==============================================================================
--- head/usr.bin/killall/killall.c	Sat Jun 30 16:23:08 2012	(r237846)
+++ head/usr.bin/killall/killall.c	Sat Jun 30 16:36:22 2012	(r237847)
@@ -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));



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201206301636.q5UGaNCB029813>