mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 16:35:06 -05:00
logging: don't write fatal messages to invalid descriptor
If opening the log file specified with the -l option failed (after closing all descriptors), the error message is written to an invalid descriptor as no log file or syslog is opened yet. Fix the code to track when the output is usable.
This commit is contained in:
@@ -105,7 +105,7 @@ extern void LOG_OpenFileLog(const char *log_file);
|
||||
/* Log messages to syslog instead of stderr */
|
||||
extern void LOG_OpenSystemLog(void);
|
||||
|
||||
/* Send fatal message also to the foreground process */
|
||||
/* Stop using stderr and send fatal message to the foreground process */
|
||||
extern void LOG_SetParentFd(int fd);
|
||||
|
||||
/* Close the pipe to the foreground process so it can exit */
|
||||
|
||||
Reference in New Issue
Block a user