summaryrefslogtreecommitdiff
path: root/games
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1997-09-11 22:55:51 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1997-09-11 22:55:51 +0000
commitc8d88a42d6fc17e580bd9eb88754e7528f7577e9 (patch)
treef76ada2a5289196b1da8b5b9e2cde0b3bb9a4a5a /games
parent8bf8f6ddfc35800c20e6d24a4eb2714c440b03ea (diff)
vfork paranoia
Diffstat (limited to 'games')
-rw-r--r--games/cribbage/instr.c12
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);