the fork succeeded, and we cannot use vfork, as we need to write an
error message if the exec failed.
int olderrno;
int fd;
- if ((pid = vfork()) > 0) {
+ if ((pid = fork()) > 0) {
return;
} else if (pid == 0) {
- snprintf(command, PATH_MAX, "%s/%s", home, ".mdeliver-processor");
+ snprintf(command, sizeof(command), "%s/%s",
+ home, ".mdeliver-processor");
execl(command, command, newfn, NULL);
if (errno == ENOENT) {
/* Not having a processor is not an error. */
}
fail = "exec";
} else {
- fail = "vfork";
+ fail = "fork";
}
olderrno = errno;
close(fd);
}
- _exit(0);
+ if (fail[0] == 'e') {
+ _exit(0);
+ }
}
int