summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2002-01-30 17:02:56 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2002-01-30 17:02:56 +0000
commitf3f5188fb43d61ba89fc3629e1c272402166067e (patch)
treeefae1ca6d8c8efe546d031c2cc009f8fdd5eab49
parentf6650ee98294437bcfac9b8439523932333231bb (diff)
always check for kvm_openfiles failure; pointed out by juan@coredump.com.ar in pr/2362
-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 62b56f8410e..2ec97eff64f 100644
--- a/bin/ps/ps.c
+++ b/bin/ps/ps.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ps.c,v 1.23 2001/09/27 12:53:47 mpech Exp $ */
+/* $OpenBSD: ps.c,v 1.24 2002/01/30 17:02:55 mickey 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.23 2001/09/27 12:53:47 mpech Exp $";
+static char rcsid[] = "$OpenBSD: ps.c,v 1.24 2002/01/30 17:02:55 mickey Exp $";
#endif
#endif /* not lint */
@@ -286,7 +286,7 @@ main(argc, argv)
}
kd = kvm_openfiles(nlistf, memf, swapf, O_RDONLY, errbuf);
- if (kd == NULL && (nlistf != NULL || memf != NULL || swapf != NULL))
+ if (kd == NULL)
errx(1, "%s", errbuf);
setegid(getgid());