Only initialize array of mibs once.
MFC after: 3 days
This commit is contained in:
parent
40bcb503f1
commit
a488a0f1d2
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=237845
@ -278,9 +278,6 @@ main(int ac, char **av)
|
|||||||
size = 0;
|
size = 0;
|
||||||
mib[0] = CTL_KERN;
|
mib[0] = CTL_KERN;
|
||||||
mib[1] = KERN_PROC;
|
mib[1] = KERN_PROC;
|
||||||
mib[2] = KERN_PROC_PROC;
|
|
||||||
mib[3] = 0;
|
|
||||||
miblen = 3;
|
|
||||||
|
|
||||||
if (user) {
|
if (user) {
|
||||||
mib[2] = eflag ? KERN_PROC_UID : KERN_PROC_RUID;
|
mib[2] = eflag ? KERN_PROC_UID : KERN_PROC_RUID;
|
||||||
@ -290,6 +287,10 @@ main(int ac, char **av)
|
|||||||
mib[2] = KERN_PROC_TTY;
|
mib[2] = KERN_PROC_TTY;
|
||||||
mib[3] = tdev;
|
mib[3] = tdev;
|
||||||
miblen = 4;
|
miblen = 4;
|
||||||
|
} else {
|
||||||
|
mib[2] = KERN_PROC_PROC;
|
||||||
|
mib[3] = 0;
|
||||||
|
miblen = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
procs = NULL;
|
procs = NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user