From fd2f66341644ba206b4604add2bc604403169406 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Thu, 31 Oct 2024 10:40:46 +0000 Subject: [PATCH] logerr: use LOG_NDELAY for openlog This ensures openlog gets a fd so logging of errors can occur within privsep where no log was written before entering privsep. Also ensures that closelog does not close -1 on some platforms where no logging took place. --- src/logerr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/logerr.c b/src/logerr.c index fef33dea..3e5cd835 100644 --- a/src/logerr.c +++ b/src/logerr.c @@ -447,7 +447,7 @@ int logopen(const char *path) { struct logctx *ctx = &_logctx; - int opts = 0; + int opts = LOG_NDELAY; /* Ensure openlog gets a fd */ /* Cache timezone */ tzset(); -- 2.47.2