summaryrefslogtreecommitdiffstats
path: root/usr.bin/systat/vmstat.c
diff options
context:
space:
mode:
authorericj <ericj@openbsd.org>2001-05-04 16:48:34 +0000
committerericj <ericj@openbsd.org>2001-05-04 16:48:34 +0000
commit1d2f3f08c9cd5fb1a28e82d760e471ebe467289d (patch)
tree115fe7100f25a4ef7a137407a19804707ecc2556 /usr.bin/systat/vmstat.c
parentInstall empty sudoers file in /etc (diff)
downloadwireguard-openbsd-1d2f3f08c9cd5fb1a28e82d760e471ebe467289d.tar.xz
wireguard-openbsd-1d2f3f08c9cd5fb1a28e82d760e471ebe467289d.zip
handle kvm_nlist() failing, from pr#1798.
Patch similar to the one submitted by <peterw@documenta.com.au>
Diffstat (limited to 'usr.bin/systat/vmstat.c')
-rw-r--r--usr.bin/systat/vmstat.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.bin/systat/vmstat.c b/usr.bin/systat/vmstat.c
index b550e469c0a..cf4e5204a8a 100644
--- a/usr.bin/systat/vmstat.c
+++ b/usr.bin/systat/vmstat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmstat.c,v 1.21 2000/02/22 21:24:02 deraadt Exp $ */
+/* $OpenBSD: vmstat.c,v 1.22 2001/05/04 16:48:34 ericj Exp $ */
/* $NetBSD: vmstat.c,v 1.5 1996/05/10 23:16:40 thorpej Exp $ */
/*-
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)vmstat.c 8.2 (Berkeley) 1/12/94";
#endif
-static char rcsid[] = "$OpenBSD: vmstat.c,v 1.21 2000/02/22 21:24:02 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: vmstat.c,v 1.22 2001/05/04 16:48:34 ericj Exp $";
#endif /* not lint */
/*
@@ -212,14 +212,14 @@ int
initkre()
{
char *intrnamebuf, *cp;
- int i;
+ int i, ret;
static int once = 0;
if (namelist[0].n_type == 0) {
- if (kvm_nlist(kd, namelist)) {
+ if ((ret = kvm_nlist(kd, namelist)) == -1)
+ errx(1, "%s", kvm_geterr(kd));
+ else if (ret)
nlisterr(namelist);
- return(0);
- }
if (namelist[0].n_type == 0) {
error("No namelist");
return(0);