fix problem where kvm_getprocs(), ..., kvm_freeprocs(), kvm_getprocs()

would get no processes.
This commit is contained in:
cgd 1993-05-11 06:44:54 +00:00
parent e439c311cd
commit de5b7fe74a
2 changed files with 4 additions and 4 deletions

View File

@ -428,8 +428,8 @@ kvm_getprocs(what, arg)
return (-1);
}
copysize = ret;
if (copysize > ocopysize) {
if (ocopysize == -1)
if (copysize > ocopysize || !kvmprocbase) {
if (ocopysize == -1 || !kvmprocbase)
kvmprocbase =
(struct kinfo_proc *)malloc(copysize);
else

View File

@ -428,8 +428,8 @@ kvm_getprocs(what, arg)
return (-1);
}
copysize = ret;
if (copysize > ocopysize) {
if (ocopysize == -1)
if (copysize > ocopysize || !kvmprocbase) {
if (ocopysize == -1 || !kvmprocbase)
kvmprocbase =
(struct kinfo_proc *)malloc(copysize);
else