mhshow: Wait for children synchonously because we run them serialized.
authormarkus schnalke <meillo@marmaro.de>
Sat, 14 Apr 2012 17:44:41 +0000 (19:44 +0200)
committermarkus schnalke <meillo@marmaro.de>
Sat, 14 Apr 2012 17:44:41 +0000 (19:44 +0200)
uip/mhshowsbr.c

index 4a7fc0c..3bcf84f 100644 (file)
@@ -22,7 +22,6 @@ extern int debugsw;
 
 int nolist   = 0;
 char *formsw = NULL;
-pid_t xpid = 0;
 
 
 /* mhparse.c */
@@ -100,9 +99,6 @@ show_all_messages(CT *cts)
 static void
 show_single_message(CT ct, char *form)
 {
-       sigset_t set, oset;
-       int status;
-
        /*
        ** Allow user executable bit so that temporary directories created by
        ** the viewer (e.g., lynx) are going to be accessible
@@ -115,8 +111,6 @@ show_single_message(CT ct, char *form)
        */
        if (form)
                DisplayMsgHeader(ct, form);
-       else
-               xpid = 0;
 
        /* Show the body of the message */
        show_switch(ct, 0);
@@ -128,23 +122,6 @@ show_single_message(CT ct, char *form)
        if (ct->c_ceclosefnx)
                (*ct->c_ceclosefnx) (ct);
 
-       /* block a few signals */
-       sigemptyset(&set);
-       sigaddset(&set, SIGHUP);
-       sigaddset(&set, SIGINT);
-       sigaddset(&set, SIGQUIT);
-       sigaddset(&set, SIGTERM);
-       sigprocmask(SIG_BLOCK, &set, &oset);
-
-       while (wait(&status) != NOTOK) {
-               pidcheck(status);
-               continue;
-       }
-
-       /* reset the signal mask */
-       sigprocmask(SIG_SETMASK, &oset, &set);
-
-       xpid = 0;
        flush_errors();
 }
 
@@ -182,7 +159,7 @@ DisplayMsgHeader(CT ct, char *form)
                /* NOTREACHED */
 
        default:
-               xpid = child_id;
+               pidcheck(pidwait(child_id, NOTOK));
                break;
        }
 }
@@ -459,11 +436,6 @@ show_content_aux2(CT ct, int alternate, char *cracked,
 {
        pid_t child_id;
 
-       if (xpid) {
-               pidcheck(pidwait(xpid, NOTOK));
-               xpid = 0;
-       }
-
        if (debugsw || cracked) {
                fflush(stdout);