[exim-cvs] More detail in file open-fail log line

Pàgina inicial
Delete this message
Reply to this message
Autor: Exim Git Commits Mailing List
Data:  
A: exim-cvs
Assumpte: [exim-cvs] More detail in file open-fail log line
Gitweb: https://git.exim.org/exim.git/commitdiff/4d756df0d59a0dfa02d453ae3dd666e180e6fbfc
Commit:     4d756df0d59a0dfa02d453ae3dd666e180e6fbfc
Parent:     2a2da1cfd5922e90ef0348483f815e23451d7747
Author:     Jeremy Harris <jgh146exb@???>
AuthorDate: Mon Sep 30 11:11:43 2024 +0100
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Mon Sep 30 11:11:43 2024 +0100


    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)

--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-cvs.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-cvs-unsubscribe@???
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/