summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2012-06-30 16:21:51 +0000
committerkib <kib@FreeBSD.org>2012-06-30 16:21:51 +0000
commit9d420f977d2cfaffa4a1e26d473efadf62f61f2b (patch)
tree0a345415006fb4b0129f314673b781cb1033ef8f /usr.bin
parent23984258873d2469108f67a6085e0bc92aad0105 (diff)
downloadFreeBSD-src-9d420f977d2cfaffa4a1e26d473efadf62f61f2b.zip
FreeBSD-src-9d420f977d2cfaffa4a1e26d473efadf62f61f2b.tar.gz
Only initialize array of mibs once.
MFC after: 3 days
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/killall/killall.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/killall/killall.c b/usr.bin/killall/killall.c
index 4a1d2b0..9f8812a 100644
--- a/usr.bin/killall/killall.c
+++ b/usr.bin/killall/killall.c
@@ -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;
OpenPOWER on IntegriCloud