X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/f3ebb786e451da973560f1c9d8cdb151d25108b5..4b01271fa595a08e68ba8c58d6404e83623aa9c8:/src/src/log.c diff --git a/src/src/log.c b/src/src/log.c index e2543a74d..2dd85c484 100644 --- a/src/src/log.c +++ b/src/src/log.c @@ -313,7 +313,7 @@ Returns: a file descriptor, or < 0 on failure (errno set) int log_create_as_exim(uschar *name) { -pid_t pid = fork(); +pid_t pid = exim_fork(US"logfile-create"); int status = 1; int fd = -1; @@ -510,7 +510,7 @@ non-setuid binary with log_arguments set, called in certain ways.) Rather than just bombing out, force the log to stderr and carry on if stderr is available. */ -if (euid != root_uid && euid != exim_uid && log_stderr != NULL) +if (euid != root_uid && euid != exim_uid && log_stderr) { *fd = fileno(log_stderr); return; @@ -519,7 +519,9 @@ if (euid != root_uid && euid != exim_uid && log_stderr != NULL) /* Otherwise this is a disaster. This call is deliberately ONLY to the panic log. If possible, save a copy of the original line that was being logged. If we are recursing (can't open the panic log either), the pointer will already be -set. */ +set. Also, when we had to use a subprocess for the create we didn't retrieve +errno from it, so get the error from the open attempt above (which is often +meaningful enough, so leave it). */ if (!panic_save_buffer) if ((panic_save_buffer = US malloc(LOG_BUFFER_SIZE)))