fflush(stdout);
- for (i = 0; (child_id = vfork()) == NOTOK && i < 5; i++)
+ for (i = 0; (child_id = fork()) == NOTOK && i < 5; i++)
sleep(5);
switch (child_id) {
show_switch(CT ct, int serial, int alternate)
{
switch (ct->c_type) {
- case CT_MULTIPART:
- return show_multi(ct, serial, alternate);
- break;
+ case CT_MULTIPART:
+ return show_multi(ct, serial, alternate);
+ break;
- case CT_MESSAGE:
- switch (ct->c_subtype) {
- case MESSAGE_PARTIAL:
- return show_partial(ct, serial,
- alternate);
- break;
+ case CT_MESSAGE:
+ switch (ct->c_subtype) {
+ case MESSAGE_PARTIAL:
+ return show_partial(ct, serial, alternate);
+ break;
- case MESSAGE_EXTERNAL:
- return show_external(ct, serial,
- alternate);
- break;
+ case MESSAGE_EXTERNAL:
+ return show_external(ct, serial, alternate);
+ break;
- case MESSAGE_RFC822:
- default:
- return show_message_rfc822(ct, serial,
- alternate);
- break;
- }
- break;
+ case MESSAGE_RFC822:
+ default:
+ return show_message_rfc822(ct, serial,
+ alternate);
+ break;
+ }
+ break;
- case CT_TEXT:
- return show_text(ct, serial, alternate);
- break;
+ case CT_TEXT:
+ return show_text(ct, serial, alternate);
+ break;
- case CT_AUDIO:
- case CT_IMAGE:
- case CT_VIDEO:
- case CT_APPLICATION:
- return show_content(ct, serial, alternate);
- break;
+ case CT_AUDIO:
+ case CT_IMAGE:
+ case CT_VIDEO:
+ case CT_APPLICATION:
+ return show_content(ct, serial, alternate);
+ break;
- default:
- adios(NULL, "unknown content type %d", ct->c_type);
- break;
+ default:
+ adios(NULL, "unknown content type %d", ct->c_type);
+ break;
}
return 0; /* NOT REACHED */
switch (*++cp) {
case 'a':
/* insert parameters from Content-Type field */
- {
+ {
char **ap, **ep;
char *s = "";
buflen -= len;
s = " ";
}
- }
- break;
+ }
+ break;
case 'd':
/* insert content description */
fflush(stdout);
- for (i = 0; (child_id = vfork()) == NOTOK && i < 5; i++)
+ for (i = 0; (child_id = fork()) == NOTOK && i < 5; i++)
sleep(5);
switch (child_id) {
- case NOTOK:
- advise("fork", "unable to");
- (*ct->c_ceclosefnx) (ct);
- return NOTOK;
+ case NOTOK:
+ advise("fork", "unable to");
+ (*ct->c_ceclosefnx) (ct);
+ return NOTOK;
- case OK:
- if (cracked)
- chdir(cracked);
- if (!xstdin)
- dup2(fd, 0);
- close(fd);
- execvp("/bin/sh", vec);
- fprintf(stderr, "unable to exec ");
- perror("/bin/sh");
- _exit(-1);
- /* NOTREACHED */
-
- default:
- if (!serial) {
- ct->c_pid = child_id;
- if (xtty)
- xpid = child_id;
- } else {
- pidcheck(pidXwait(child_id, NULL));
- }
+ case OK:
+ if (cracked)
+ chdir(cracked);
+ if (!xstdin)
+ dup2(fd, 0);
+ close(fd);
+ execvp("/bin/sh", vec);
+ fprintf(stderr, "unable to exec ");
+ perror("/bin/sh");
+ _exit(-1);
+ /* NOTREACHED */
- if (fd != NOTOK)
- (*ct->c_ceclosefnx) (ct);
- return (alternate ? DONE : OK);
+ default:
+ if (!serial) {
+ ct->c_pid = child_id;
+ if (xtty)
+ xpid = child_id;
+ } else {
+ pidcheck(pidXwait(child_id, NULL));
+ }
+
+ if (fd != NOTOK)
+ (*ct->c_ceclosefnx) (ct);
+ return (alternate ? DONE : OK);
}
}
inneresult = show_switch(p, nowserial, nowalternate);
switch (inneresult) {
- case NOTOK:
- if (alternate && !alternating) {
- result = NOTOK;
- goto out;
- }
- continue;
-
- case OK:
- case DONE:
- if (alternating) {
- result = DONE;
- break;
- }
- if (alternate) {
- alternate = nowalternate = 0;
- if (result == NOTOK)
- result = inneresult;
- }
- continue;
+ case NOTOK:
+ if (alternate && !alternating) {
+ result = NOTOK;
+ goto out;
+ }
+ continue;
+
+ case OK:
+ case DONE:
+ if (alternating) {
+ result = DONE;
+ break;
+ }
+ if (alternate) {
+ alternate = nowalternate = 0;
+ if (result == NOTOK)
+ result = inneresult;
+ }
+ continue;
}
break;
}
switch (*++cp) {
case 'a':
/* insert parameters from Content-Type field */
- {
+ {
char **ap, **ep;
char *s = "";
buflen -= len;
s = " ";
}
- }
- break;
+ }
+ break;
case 'd':
/* insert content description */