int nolist = 0;
char *formsw = NULL;
-pid_t xpid = 0;
/* mhparse.c */
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
*/
if (form)
DisplayMsgHeader(ct, form);
- else
- xpid = 0;
/* Show the body of the message */
show_switch(ct, 0);
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();
}
/* NOTREACHED */
default:
- xpid = child_id;
+ pidcheck(pidwait(child_id, NOTOK));
break;
}
}
{
pid_t child_id;
- if (xpid) {
- pidcheck(pidwait(xpid, NOTOK));
- xpid = 0;
- }
-
if (debugsw || cracked) {
fflush(stdout);