mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
kvm_getprocs: gracefully handle errors from kvm_deadprocs
and don't confuse callers with incorrect return value MFC after: 9 days
This commit is contained in:
parent
9fb9ea1c03
commit
ca895af355
1 changed files with 8 additions and 2 deletions
|
|
@ -593,9 +593,15 @@ liveout:
|
|||
|
||||
nprocs = kvm_deadprocs(kd, op, arg, nl[1].n_value,
|
||||
nl[2].n_value, nprocs);
|
||||
if (nprocs <= 0) {
|
||||
_kvm_freeprocs(kd);
|
||||
nprocs = 0;
|
||||
}
|
||||
#ifdef notdef
|
||||
size = nprocs * sizeof(struct kinfo_proc);
|
||||
(void)realloc(kd->procbase, size);
|
||||
else {
|
||||
size = nprocs * sizeof(struct kinfo_proc);
|
||||
kd->procbase = realloc(kd->procbase, size);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
*cnt = nprocs;
|
||||
|
|
|
|||
Loading…
Reference in a new issue