svn commit: r241639 - stable/9/lib/libprocstat
Andriy Gapon
avg at FreeBSD.org
Wed Oct 17 11:33:32 UTC 2012
Author: avg
Date: Wed Oct 17 11:33:32 2012
New Revision: 241639
URL: http://svn.freebsd.org/changeset/base/241639
Log:
MFC r241304: procstat_getprocs: honor kvm_getprocs interface - cnt is signed
Modified:
stable/9/lib/libprocstat/libprocstat.c
Directory Properties:
stable/9/lib/libprocstat/ (props changed)
Modified: stable/9/lib/libprocstat/libprocstat.c
==============================================================================
--- stable/9/lib/libprocstat/libprocstat.c Wed Oct 17 11:30:25 2012 (r241638)
+++ stable/9/lib/libprocstat/libprocstat.c Wed Oct 17 11:33:32 2012 (r241639)
@@ -184,15 +184,18 @@ procstat_getprocs(struct procstat *procs
struct kinfo_proc *p0, *p;
size_t len;
int name[4];
+ int cnt;
int error;
assert(procstat);
assert(count);
p = NULL;
if (procstat->type == PROCSTAT_KVM) {
- p0 = kvm_getprocs(procstat->kd, what, arg, count);
- if (p0 == NULL || count == 0)
+ *count = 0;
+ p0 = kvm_getprocs(procstat->kd, what, arg, &cnt);
+ if (p0 == NULL || cnt <= 0)
return (NULL);
+ *count = cnt;
len = *count * sizeof(*p);
p = malloc(len);
if (p == NULL) {
More information about the svn-src-stable-9
mailing list