From 4d756df0d59a0dfa02d453ae3dd666e180e6fbfc Mon Sep 17 00:00:00 2001 From: Jeremy Harris Date: Mon, 30 Sep 2024 11:11:43 +0100 Subject: [PATCH] More detail in file open-fail log line --- src/src/expand.c | 6 +++--- src/src/functions.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/src/expand.c b/src/src/expand.c index e1e6e1999..bb51bf10c 100644 --- a/src/src/expand.c +++ b/src/src/expand.c @@ -8786,8 +8786,8 @@ int fd, off = 0, len; if ((fd = exim_open2(CS filename, O_RDONLY)) < 0) { - log_write(0, LOG_MAIN | LOG_PANIC, "unable to open file for reading: %s", - filename); + log_write(0, LOG_MAIN | LOG_PANIC, "unable to open file '%s' for reading: %s", + filename, strerror(errno)); return NULL; } @@ -8956,7 +8956,7 @@ if (opt_perl_startup != NULL) uschar *errstr; printf("Starting Perl interpreter\n"); errstr = init_perl(opt_perl_startup); - if (errstr != NULL) + if (errstr) { printf("** error in perl_startup code: %s\n", errstr); return EXIT_FAILURE; diff --git a/src/src/functions.h b/src/src/functions.h index 875ce25a6..c9bb8cd70 100644 --- a/src/src/functions.h +++ b/src/src/functions.h @@ -1270,7 +1270,7 @@ if (f.running_in_test_harness && f.testsuite_delays) millisleep(millisec); } /******************************************************************************/ -/* Taint-checked file opens */ +/* Taint-checked file opens. Return values/errno per open(2). */ static inline int exim_open2(const char *pathname, int flags) -- 2.30.2