From 9b39ed7b9416390758870edd85ae19dbee651312 Mon Sep 17 00:00:00 2001 From: mike Date: Mon, 3 Jun 2002 23:13:11 +0000 Subject: Use POSIX macros for wait(2)-style status information instead of the deprecated 4.2/4.3BSD wait union. Fix some nearby pid_t/int confusion. --- games/cribbage/instr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'games/cribbage') diff --git a/games/cribbage/instr.c b/games/cribbage/instr.c index b329e33..ed06ce8 100644 --- a/games/cribbage/instr.c +++ b/games/cribbage/instr.c @@ -58,8 +58,8 @@ void instructions() { struct stat sb; - union wait pstat; pid_t pid; + int pstat; char *pager, *path; if (stat(_PATH_INSTR, &sb)) { @@ -84,7 +84,7 @@ instructions() do { pid = waitpid(pid, (int *)&pstat, 0); } while (pid == -1 && errno == EINTR); - if (pid == -1 || pstat.w_status) + if (pid == -1 || WEXITSTATUS(pstat) || WTERMSIG(pstat)) exit(1); } } -- cgit v1.1