mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 17:18:32 +00:00
Pass correct length OID to kernel for KERN_PROC_ALL.
This commit is contained in:
parent
1ccb141f89
commit
44ffb5f593
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=16158
|
@ -280,7 +280,7 @@ kvm_getprocs(kd, op, arg, cnt)
|
|||
mib[1] = KERN_PROC;
|
||||
mib[2] = op;
|
||||
mib[3] = arg;
|
||||
st = sysctl(mib, 4, NULL, &size, NULL, 0);
|
||||
st = sysctl(mib, op == KERN_PROC_ALL ? 3 : 4, NULL, &size, NULL, 0);
|
||||
if (st == -1) {
|
||||
_kvm_syserr(kd, kd->program, "kvm_getprocs");
|
||||
return (0);
|
||||
|
@ -288,7 +288,7 @@ kvm_getprocs(kd, op, arg, cnt)
|
|||
kd->procbase = (struct kinfo_proc *)_kvm_malloc(kd, size);
|
||||
if (kd->procbase == 0)
|
||||
return (0);
|
||||
st = sysctl(mib, 4, kd->procbase, &size, NULL, 0);
|
||||
st = sysctl(mib, op == KERN_PROC_ALL ? 3 : 4, kd->procbase, &size, NULL, 0);
|
||||
if (st == -1) {
|
||||
_kvm_syserr(kd, kd->program, "kvm_getprocs");
|
||||
return (0);
|
||||
|
|
Loading…
Reference in a new issue