X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Fmhmail.c;h=2b8589f5330c90c6bff6367d94138d60d4a5b7cc;hp=ebe8b7647155de8d584cd277971020dc704458f3;hb=5fbf37ee68e018998ada61eeab73e035b26834b6;hpb=f12a3e5036a986f579b80861f4421bcb86f84cee diff --git a/uip/mhmail.c b/uip/mhmail.c index ebe8b76..2b8589f 100644 --- a/uip/mhmail.c +++ b/uip/mhmail.c @@ -72,46 +72,51 @@ main(int argc, char **argv) while ((cp = *argp++)) { if (*cp == '-') { switch (smatch(++cp, switches)) { - case AMBIGSW: - ambigsw(cp, switches); - done(1); - case UNKWNSW: - adios(NULL, "-%s unknown", cp); - - case HELPSW: - snprintf(buf, sizeof(buf), "%s [addrs ... [switches]]", invo_name); - print_help(buf, switches, 0); - done(1); - case VERSIONSW: - print_version(invo_name); - done(1); - - case FROMSW: - if (!(from = *argp++) || *from == '-') - adios(NULL, "missing argument to %s", argp[-2]); - continue; - - case BODYSW: - if (!(body = *argp++) || *body == '-') - adios(NULL, "missing argument to %s", argp[-2]); - continue; - - case CCSW: - iscc++; - continue; - - case SUBJSW: - if (!(subject = *argp++) || *subject == '-') - adios(NULL, "missing argument to %s", argp[-2]); - continue; - - case RESNDSW: - resent++; - continue; - - case QUEUESW: - queued++; - continue; + case AMBIGSW: + ambigsw(cp, switches); + done(1); + case UNKWNSW: + adios(NULL, "-%s unknown", cp); + + case HELPSW: + snprintf(buf, sizeof(buf), + "%s [addrs ... [switches]]", + invo_name); + print_help(buf, switches, 0); + done(1); + case VERSIONSW: + print_version(invo_name); + done(1); + + case FROMSW: + if (!(from = *argp++) || *from == '-') + adios(NULL, "missing argument to %s", + argp[-2]); + continue; + + case BODYSW: + if (!(body = *argp++) || *body == '-') + adios(NULL, "missing argument to %s", + argp[-2]); + continue; + + case CCSW: + iscc++; + continue; + + case SUBJSW: + if (!(subject = *argp++) || *subject == '-') + adios(NULL, "missing argument to %s", + argp[-2]); + continue; + + case RESNDSW: + resent++; + continue; + + case QUEUESW: + queued++; + continue; } } if (iscc) @@ -125,7 +130,7 @@ main(int argc, char **argv) if (tolist == NULL) adios(NULL, "usage: %s addrs ... [switches]", invo_name); - tfile = m_mktemp2(NULL, invo_name, NULL, &out); + tfile = m_mktemp2("/tmp/", invo_name, NULL, &out); if (tfile == NULL) adios("mhmail", "unable to create temporary file"); chmod(tfile, 0600); @@ -168,10 +173,7 @@ main(int argc, char **argv) vec[nvec++] = "-queued"; vec[nvec] = NULL; - for (i = 0; (child_id = fork()) == NOTOK && i < 5; i++) - sleep(5); - - if (child_id == NOTOK) { + if ((child_id = fork()) == NOTOK) { /* report failure and then send it */ adios(NULL, "unable to fork"); } else if (child_id) {