From f57ecacf0ea6504be40bc1e14853effe5cc489f5 Mon Sep 17 00:00:00 2001 From: epg <> Date: Tue, 28 Mar 2006 23:23:04 +0000 Subject: [PATCH] Yikes. run_processor was having the child return back to main if exec fails. Fix that, and switch to vfork. --- mdeliver.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mdeliver.c b/mdeliver.c index 3c8acf8..1b741e1 100644 --- a/mdeliver.c +++ b/mdeliver.c @@ -276,18 +276,18 @@ run_processor(char *home, char *newfn) int olderrno; int fd; - if ((pid = fork()) > 0) { + if ((pid = vfork()) > 0) { return; } else if (pid == 0) { snprintf(command, PATH_MAX, "%s/%s", home, ".mdeliver-processor"); execl(command, command, newfn, NULL); if (errno == ENOENT) { /* Not having a processor is not an error. */ - return; + _exit(0); } fail = "exec"; } else { - fail = "fork"; + fail = "vfork"; } olderrno = errno; @@ -306,6 +306,8 @@ run_processor(char *home, char *newfn) fsync(fd); close(fd); } + + _exit(0); } int -- 2.56.0