Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 30 Jun 2012 16:21:52 +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: r237845 - head/usr.bin/killall
Message-ID:  <201206301621.q5UGLqvG028953@svn.freebsd.org>

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

Log:
  Only initialize array of mibs once.
  
  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:20:01 2012	(r237844)
+++ head/usr.bin/killall/killall.c	Sat Jun 30 16:21:51 2012	(r237845)
@@ -278,9 +278,6 @@ main(int ac, char **av)
 	size = 0;
 	mib[0] = CTL_KERN;
 	mib[1] = KERN_PROC;
-	mib[2] = KERN_PROC_PROC;
-	mib[3] = 0;
-	miblen = 3;
 
 	if (user) {
 		mib[2] = eflag ? KERN_PROC_UID : KERN_PROC_RUID;
@@ -290,6 +287,10 @@ main(int ac, char **av)
 		mib[2] = KERN_PROC_TTY;
 		mib[3] = tdev;
 		miblen = 4;
+	} else {
+		mib[2] = KERN_PROC_PROC;
+		mib[3] = 0;
+		miblen = 3;
 	}
 
 	procs = NULL;



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