summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Pechkin <mpech@cvs.openbsd.org>2001-09-27 12:53:48 +0000
committerMike Pechkin <mpech@cvs.openbsd.org>2001-09-27 12:53:48 +0000
commit2d733148a9c1c901010b0ab48307c7e16b24070c (patch)
treed9a712635f8cc27e0226c4cfb68df76f7b4d5b29
parent5d7fdaf5af9967aaccd17747707b047df4aefc06 (diff)
If kvm_openfiles() fail the systctl() should work.
Spotted by: mike <mike@gravitino.net> Patch from millert@
-rw-r--r--bin/ps/ps.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/ps/ps.c b/bin/ps/ps.c
index 5d8b689e28b..62b56f8410e 100644
--- a/bin/ps/ps.c
+++ b/bin/ps/ps.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ps.c,v 1.22 2001/09/06 13:29:08 mpech Exp $ */
+/* $OpenBSD: ps.c,v 1.23 2001/09/27 12:53:47 mpech Exp $ */
/* $NetBSD: ps.c,v 1.15 1995/05/18 20:33:25 mycroft Exp $ */
/*-
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)ps.c 8.4 (Berkeley) 4/2/94";
#else
-static char rcsid[] = "$OpenBSD: ps.c,v 1.22 2001/09/06 13:29:08 mpech Exp $";
+static char rcsid[] = "$OpenBSD: ps.c,v 1.23 2001/09/27 12:53:47 mpech Exp $";
#endif
#endif /* not lint */
@@ -286,7 +286,7 @@ main(argc, argv)
}
kd = kvm_openfiles(nlistf, memf, swapf, O_RDONLY, errbuf);
- if (kd == 0)
+ if (kd == NULL && (nlistf != NULL || memf != NULL || swapf != NULL))
errx(1, "%s", errbuf);
setegid(getgid());