diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-09-11 22:55:51 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-09-11 22:55:51 +0000 |
commit | c8d88a42d6fc17e580bd9eb88754e7528f7577e9 (patch) | |
tree | f76ada2a5289196b1da8b5b9e2cde0b3bb9a4a5a /games | |
parent | 8bf8f6ddfc35800c20e6d24a4eb2714c440b03ea (diff) |
vfork paranoia
Diffstat (limited to 'games')
-rw-r--r-- | games/cribbage/instr.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/games/cribbage/instr.c b/games/cribbage/instr.c index 83a41948808..b7351f009d5 100644 --- a/games/cribbage/instr.c +++ b/games/cribbage/instr.c @@ -69,16 +69,18 @@ instructions() strerror(errno)); exit(1); } + + if (!(path = getenv("PAGER"))) + path = _PATH_MORE; + if ((pager = strrchr(path, '/'))) + ++pager; + pager = path; + switch (pid = vfork()) { case -1: (void)fprintf(stderr, "cribbage: %s.\n", strerror(errno)); exit(1); case 0: - if (!(path = getenv("PAGER"))) - path = _PATH_MORE; - if ((pager = strrchr(path, '/'))) - ++pager; - pager = path; execlp(path, pager, _PATH_INSTR, NULL); (void)fprintf(stderr, "cribbage: %s.\n", strerror(errno)); _exit(1); |