Skip to content

Commit

Permalink
logerr: use LOG_NDELAY for openlog
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rsmarples committed Oct 31, 2024
1 parent e354743 commit fd2f663
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/logerr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit fd2f663

Please sign in to comment.