From: markus schnalke Date: Sat, 14 Apr 2012 17:44:41 +0000 (+0200) Subject: mhshow: Wait for children synchonously because we run them serialized. X-Git-Tag: mmh-thesis-end~83 X-Git-Url: http://git.marmaro.de/?p=mmh;a=commitdiff_plain;h=7ca05c3df912f540c1f25b3be4d1733f5a3ad1b4 mhshow: Wait for children synchonously because we run them serialized. --- diff --git a/uip/mhshowsbr.c b/uip/mhshowsbr.c index 4a7fc0c..3bcf84f 100644 --- a/uip/mhshowsbr.c +++ b/uip/mhshowsbr.c @@ -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);