From: epg <> Date: Fri, 13 Sep 2002 01:43:09 +0000 (+0000) Subject: (run_processor): Now only takes a single argument, the filename of the X-Git-Url: https://diplodocus.org/git/mdeliver/commitdiff_plain/3173cae8584b510bd08307545c5858afcaa0ed8b (run_processor): Now only takes a single argument, the filename of the new message. The process to run is now hard-coded to be a dot-file in the user's home directory. (main): Now unconditionally call run_processor. --- diff --git a/mdeliver.c b/mdeliver.c index 6b4debd..68b8691 100644 --- a/mdeliver.c +++ b/mdeliver.c @@ -251,7 +251,7 @@ deliver(char *maildir, char *newfn) /* Run a program to process the new message. */ static void -run_processor(char *argv[], char *newfn) +run_processor(char *newfn) { pid_t pid; FILE *errfile; @@ -262,9 +262,11 @@ run_processor(char *argv[], char *newfn) if ((pid = fork()) > 0) { return; } else if (pid == 0) { - argv[0] = argv[1]; - argv[1] = newfn; - execv(argv[0], argv); + execl(".mdeliver-processor", ".mdeliver-processor", newfn, NULL); + if (errno == ENOENT) { + /* Not having a processor is not an error. */ + return; + } fail = "exec"; } else { fail = "fork"; @@ -304,9 +306,7 @@ main(int argc, char *argv[]) deliver("Maildir", newfn); - if (argv[1]) { - run_processor(argv, newfn); - } + run_processor(newfn); /* Always return 0 because deliver exits if it fails, and if it * succeeds we cannot return a failure code to the MTA. */