X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/f52aa1ce52a53ead867f840f18c834871925de6c..bcb443a54dc3e08c2aa51fa1dd414cf2023fc037:/uip/sendsbr.c diff --git a/uip/sendsbr.c b/uip/sendsbr.c index 06358fd3..3bc3df15 100644 --- a/uip/sendsbr.c +++ b/uip/sendsbr.c @@ -838,7 +838,7 @@ sendaux (char **vec, int vecp, char *drft, struct stat *st) done (1); vec[vecp] = NULL; - 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) { @@ -908,8 +908,10 @@ static void alert (char *file, int out) { pid_t child_id; - int i, in; + int i, in, argp; char buf[BUFSIZ]; + char *program; + char **arglist; for (i = 0; (child_id = fork()) == NOTOK && i < 5; i++) sleep (5); @@ -949,8 +951,14 @@ alert (char *file, int out) snprintf (buf, sizeof(buf), "send failed on %s", forwsw ? "enclosed draft" : file); - execlp (mailproc, r1bindex (mailproc, '/'), getusername (), - "-subject", buf, NULL); + arglist = argsplit(mailproc, &program, &argp); + + arglist[argp++] = getusername(); + arglist[argp++] = "-subject"; + arglist[argp++] = buf; + arglist[argp] = NULL; + + execvp (program, arglist); fprintf (stderr, "unable to exec "); perror (mailproc); _exit (-1);