summaryrefslogtreecommitdiff
path: root/lib/libkvm/kvm_getloadavg.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2006-03-31 03:59:41 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2006-03-31 03:59:41 +0000
commita27510c5b1c8198d7abc8a432fdf9dc6434f86d1 (patch)
tree6f5cdac8d7982994c3195d62e0a90ed325197df9 /lib/libkvm/kvm_getloadavg.c
parent05fdd8242174c8f464a279d3f4a232ecdb8be8f0 (diff)
careful cleanup following advice from lint. be very very very careful
with sprinkling in size_t!
Diffstat (limited to 'lib/libkvm/kvm_getloadavg.c')
-rw-r--r--lib/libkvm/kvm_getloadavg.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libkvm/kvm_getloadavg.c b/lib/libkvm/kvm_getloadavg.c
index 371b3eb8e6b..38dc4c838f9 100644
--- a/lib/libkvm/kvm_getloadavg.c
+++ b/lib/libkvm/kvm_getloadavg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kvm_getloadavg.c,v 1.6 2004/06/15 03:52:59 deraadt Exp $ */
+/* $OpenBSD: kvm_getloadavg.c,v 1.7 2006/03/31 03:59:40 deraadt Exp $ */
/* $NetBSD: kvm_getloadavg.c,v 1.2 1996/03/18 22:33:31 thorpej Exp $ */
/*-
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)kvm_getloadavg.c 8.1 (Berkeley) 6/4/93";
#else
-static char *rcsid = "$OpenBSD: kvm_getloadavg.c,v 1.6 2004/06/15 03:52:59 deraadt Exp $";
+static char *rcsid = "$OpenBSD: kvm_getloadavg.c,v 1.7 2006/03/31 03:59:40 deraadt Exp $";
#endif
#endif /* LIBC_SCCS and not lint */
@@ -87,6 +87,7 @@ kvm_getloadavg(kvm_t *kd, double loadavg[], int nelem)
#define KREAD(kd, addr, obj) \
(kvm_read(kd, addr, (char *)(obj), sizeof(*obj)) != sizeof(*obj))
+
if (KREAD(kd, nl[X_AVERUNNABLE].n_value, &loadinfo)) {
_kvm_err(kd, kd->program, "can't read averunnable");
return (-1);