Clean up process wait to use POSIX waitpid() interface.
[mmh] / uip / mhshowsbr.c
index 368b25c..d3397ae 100644 (file)
 #include <h/mhparse.h>
 #include <h/utils.h>
 
-#ifdef HAVE_SYS_WAIT_H
-# include <sys/wait.h>
-#endif
-
 /*
  * Just use sigjmp/longjmp on older machines that
  * don't have sigsetjmp/siglongjmp.
@@ -132,11 +128,7 @@ show_single_message (CT ct, char *form)
 {
     sigset_t set, oset;
 
-#ifdef HAVE_UNION_WAIT
-    union wait status;
-#else
     int status;
-#endif
 
     /* Allow user executable bit so that temporary directories created by
      * the viewer (e.g., lynx) are going to be accessible */
@@ -170,11 +162,7 @@ show_single_message (CT ct, char *form)
     SIGPROCMASK (SIG_BLOCK, &set, &oset);
 
     while (wait (&status) != NOTOK) {
-#ifdef HAVE_UNION_WAIT
-       pidcheck (status.w_status);
-#else
        pidcheck (status);
-#endif
        continue;
     }
 
@@ -783,11 +771,7 @@ show_multi_internal (CT ct, int serial, int alternate)
     if (serial && !nowserial) {
        pid_t pid;
        int kids;
-#ifdef HAVE_UNION_WAIT
-       union wait status;
-#else
        int status;
-#endif
 
        kids = 0;
        for (part = m->mp_parts; part; part = part->mp_next) {
@@ -802,11 +786,7 @@ show_multi_internal (CT ct, int serial, int alternate)
        }
 
        while (kids > 0 && (pid = wait (&status)) != NOTOK) {
-#ifdef HAVE_UNION_WAIT
-           pidcheck (status.w_status);
-#else
            pidcheck (status);
-#endif
 
            for (part = m->mp_parts; part; part = part->mp_next) {
                p = part->mp_part;