From e8fab94f10ad67c52ceb425c4912c4725728f441 Mon Sep 17 00:00:00 2001
From: Fabian Keil <fk@fabiankeil.de>
Date: Fri, 6 Sep 2024 13:41:22 +0200
Subject: [PATCH] init_error_log(): Include the reason for failures to open the
 log file

---
 errlog.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/errlog.c b/errlog.c
index 3446b721..da6af45e 100644
--- a/errlog.c
+++ b/errlog.c
@@ -339,7 +339,7 @@ void init_error_log(const char *prog_name, const char *logfname)
        * reopen it if the file name changed or if the
        * configuration reload was caused by a SIGHUP.
        */
-      log_error(LOG_LEVEL_INFO, "Failed to reopen logfile: \'%s\'. "
+      log_error(LOG_LEVEL_INFO, "Failed to reopen logfile: \'%s\': %E. "
          "Retrying after closing the old file descriptor first. If that "
          "doesn't work, Privoxy will exit without being able to log a message.",
          logfname);
@@ -352,7 +352,8 @@ void init_error_log(const char *prog_name, const char *logfname)
 
    if (NULL == fp)
    {
-      log_error(LOG_LEVEL_FATAL, "init_error_log(): can't open logfile: \'%s\'", logfname);
+      log_error(LOG_LEVEL_FATAL,
+         "init_error_log(): can't open logfile \'%s\': %E", logfname);
    }
 
 #ifdef FEATURE_EXTERNAL_FILTERS
-- 
2.49.0