X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/5c01446c027960e00b33f623212de645475569aa..4b846eff7deb83d1019868cabf7f794651502432:/uip/whatnowsbr.c diff --git a/uip/whatnowsbr.c b/uip/whatnowsbr.c index b02b5e22..10291617 100644 --- a/uip/whatnowsbr.c +++ b/uip/whatnowsbr.c @@ -44,6 +44,7 @@ #ifdef OAUTH_SUPPORT # include #endif +#include "h/done.h" #include "sbr/m_maildir.h" #include "sbr/m_mktemp.h" #include "sbr/mime_type.h" @@ -722,7 +723,7 @@ editfile (char **ed, char **arg, char *file, int use, struct msgs *mp, execvp (prog, vec); fprintf (stderr, "unable to exec "); perror (*ed); - _exit (-1); + _exit(1); default: if ((status = pidwait (pid, NOTOK))) { @@ -821,8 +822,8 @@ sendfile (char **arg, char *file, int pushsw) child_id = fork(); switch (child_id) { case NOTOK: - inform("unable to fork, so sending directly..."); - /* FALLTHRU */ + adios("fork", "failed:"); + case OK: vec = argsplit(sendproc, &program, &vecp); if (pushsw) @@ -836,7 +837,7 @@ sendfile (char **arg, char *file, int pushsw) execvp (program, vec); fprintf (stderr, "unable to exec "); perror (sendproc); - _exit (-1); + _exit(1); default: if (pidwait(child_id, OK) == 0) @@ -864,7 +865,7 @@ buildfile (char **argp, char *file) while (argp[i]) i++; } - args = (char **) mh_xmalloc((i + 2) * sizeof(char *)); + args = mh_xmalloc((i + 2) * sizeof(char *)); /* * For backward compatibility, we need to add -build @@ -979,10 +980,6 @@ sendit (char *sp, char **arg, char *file, int pushed) int snoop = 0; struct stat st; -#ifndef lint - int distsw = 0; -#endif - /* * Make sure these are defined. In particular, we need * savearg[1] to be NULL, in case "arg" is NULL below. It @@ -1205,14 +1202,11 @@ sendit (char *sp, char **arg, char *file, int pushed) if ((cp = getenv ("mhdist")) && *cp -#ifndef lint - && (distsw = atoi (cp)) -#endif /* not lint */ + && atoi(cp) && altmsg) { vec[vecp++] = "-dist"; if ((cp = m_mktemp2(altmsg, invo_name, NULL, NULL)) == NULL) { - adios(NULL, "unable to create temporary file in %s", - get_temp_dir()); + adios(NULL, "unable to create temporary file"); } distfile = mh_xstrdup(cp); (void) m_unlink(distfile); @@ -1280,7 +1274,7 @@ whomfile (char **arg, char *file) execvp (program, vec); fprintf (stderr, "unable to exec "); perror (whomproc); - _exit (-1); /* NOTREACHED */ + _exit(1); /* NOTREACHED */ default: return pidwait(pid, NOTOK) & 0377 ? 1 : 0;