diff options
author | Florian Obser <florian@cvs.openbsd.org> | 2019-02-05 18:13:21 +0000 |
---|---|---|
committer | Florian Obser <florian@cvs.openbsd.org> | 2019-02-05 18:13:21 +0000 |
commit | 9f3786a186b5e63b8801600f4477029f8d779265 (patch) | |
tree | 4bcc73eb3c995a02c1bd5d793ec3364f63e54a7f /bin/ps/ps.c | |
parent | 9c776440f32add94000cf07a0ef69dff8ea64ef5 (diff) |
Let ps(1) work in single user mode where /var/run does not exist.
Give the same treatment if /dev doesn't exist. While things will be
real interesting without /dev there is no reason to stop ps(1).
Fix suggested by & OK deraadt
OK millert
Diffstat (limited to 'bin/ps/ps.c')
-rw-r--r-- | bin/ps/ps.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/ps/ps.c b/bin/ps/ps.c index 7892805e172..611c1d30e7c 100644 --- a/bin/ps/ps.c +++ b/bin/ps/ps.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ps.c,v 1.73 2018/09/16 02:44:06 millert Exp $ */ +/* $OpenBSD: ps.c,v 1.74 2019/02/05 18:13:20 florian Exp $ */ /* $NetBSD: ps.c,v 1.15 1995/05/18 20:33:25 mycroft Exp $ */ /*- @@ -272,9 +272,9 @@ main(int argc, char *argv[]) if (kd == NULL) errx(1, "%s", errbuf); - if (unveil(_PATH_DEVDB, "r") == -1) + if (unveil(_PATH_DEVDB, "r") == -1 && errno != ENOENT) err(1, "unveil"); - if (unveil(_PATH_DEV, "r") == -1) + if (unveil(_PATH_DEV, "r") == -1 && errno != ENOENT) err(1, "unveil"); if (swapf) if (unveil(swapf, "r") == -1) |