diff --git a/games/cribbage/instr.c b/games/cribbage/instr.c index b329e332fea8..ed06ce84cf6c 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); } } diff --git a/games/sail/pl_1.c b/games/sail/pl_1.c index e51f4f90a1b9..ee12e7f305c8 100644 --- a/games/sail/pl_1.c +++ b/games/sail/pl_1.c @@ -126,8 +126,8 @@ choke() void child() { - union wait status; - int pid; + pid_t pid; + int status; (void) signal(SIGCHLD, SIG_IGN); do { diff --git a/gnu/lib/libdialog/raw_popen.c b/gnu/lib/libdialog/raw_popen.c index add71f175262..d343abe21774 100644 --- a/gnu/lib/libdialog/raw_popen.c +++ b/gnu/lib/libdialog/raw_popen.c @@ -131,8 +131,7 @@ int raw_pclose(FILE *iop) { register struct pid *cur, *last; - int omask; - union wait pstat; + int omask, pstat; pid_t pid; (void)fclose(iop); @@ -158,5 +157,5 @@ raw_pclose(FILE *iop) last->next = cur->next; free(cur); - return (pid == -1 ? -1 : pstat.w_status); + return (pid == -1 ? -1 : pstat); } diff --git a/usr.bin/rlogin/rlogin.c b/usr.bin/rlogin/rlogin.c index 5642066cd77f..edf908bb8a87 100644 --- a/usr.bin/rlogin/rlogin.c +++ b/usr.bin/rlogin/rlogin.c @@ -468,16 +468,16 @@ writeroob(int signo __unused) void catch_child(int signo __unused) { - union wait status; - int pid; + pid_t pid; + int status; for (;;) { - pid = wait3((int *)&status, WNOHANG|WUNTRACED, NULL); + pid = wait3(&status, WNOHANG|WUNTRACED, NULL); if (pid == 0) return; /* if the child (reader) dies, just quit */ if (pid < 0 || (pid == child && !WIFSTOPPED(status))) - done((int)(status.w_termsig | status.w_retcode)); + done(WTERMSIG(status) | WEXITSTATUS(status)); } /* NOTREACHED */ } diff --git a/usr.bin/script/script.c b/usr.bin/script/script.c index 0019a46280f5..c58923980372 100644 --- a/usr.bin/script/script.c +++ b/usr.bin/script/script.c @@ -209,11 +209,11 @@ usage() void finish() { - int die, e, pid; - union wait status; + pid_t pid; + int die, e, status; die = e = 0; - while ((pid = wait3((int *)&status, WNOHANG, 0)) > 0) + while ((pid = wait3(&status, WNOHANG, 0)) > 0) if (pid == child) { die = 1; if (WIFEXITED(status)) diff --git a/usr.bin/window/wwchild.c b/usr.bin/window/wwchild.c index 8b82fac129ec..3ff46ece4059 100644 --- a/usr.bin/window/wwchild.c +++ b/usr.bin/window/wwchild.c @@ -48,10 +48,9 @@ static char rcsid[] = void wwchild() { - int olderrno; register struct ww **wp; - union wait w; - int pid; + pid_t pid; + int olderrno, w; char collected = 0; olderrno = errno;