summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--games/cribbage/instr.c4
-rw-r--r--games/sail/pl_1.c4
-rw-r--r--gnu/lib/libdialog/raw_popen.c5
-rw-r--r--usr.bin/rlogin/rlogin.c8
-rw-r--r--usr.bin/script/script.c6
-rw-r--r--usr.bin/window/wwchild.c5
6 files changed, 15 insertions, 17 deletions
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);
}
}
diff --git a/games/sail/pl_1.c b/games/sail/pl_1.c
index e51f4f9..ee12e7f 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 add71f1..d343abe 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 5642066..edf908b 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 0019a46..c589239 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 8b82fac..3ff46ec 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;
OpenPOWER on IntegriCloud