diff options
Diffstat (limited to 'log.c')
-rw-r--r-- | log.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -265,7 +265,7 @@ log_init(char *av0, LogLevel level, SyslogFacility facility, int on_stderr) | |||
265 | void | 265 | void |
266 | do_log(LogLevel level, const char *fmt, va_list args) | 266 | do_log(LogLevel level, const char *fmt, va_list args) |
267 | { | 267 | { |
268 | #ifdef HAVE_OPENLOG_R | 268 | #if defined(HAVE_OPENLOG_R) && defined(SYSLOG_DATA_INIT) |
269 | struct syslog_data sdata = SYSLOG_DATA_INIT; | 269 | struct syslog_data sdata = SYSLOG_DATA_INIT; |
270 | #endif | 270 | #endif |
271 | char msgbuf[MSGBUFSIZ]; | 271 | char msgbuf[MSGBUFSIZ]; |
@@ -321,7 +321,7 @@ do_log(LogLevel level, const char *fmt, va_list args) | |||
321 | snprintf(msgbuf, sizeof msgbuf, "%s\r\n", fmtbuf); | 321 | snprintf(msgbuf, sizeof msgbuf, "%s\r\n", fmtbuf); |
322 | write(STDERR_FILENO, msgbuf, strlen(msgbuf)); | 322 | write(STDERR_FILENO, msgbuf, strlen(msgbuf)); |
323 | } else { | 323 | } else { |
324 | #ifdef HAVE_OPENLOG_R | 324 | #if defined(HAVE_OPENLOG_R) && defined(SYSLOG_DATA_INIT) |
325 | openlog_r(argv0 ? argv0 : __progname, LOG_PID, log_facility, &sdata); | 325 | openlog_r(argv0 ? argv0 : __progname, LOG_PID, log_facility, &sdata); |
326 | syslog_r(pri, &sdata, "%.500s", fmtbuf); | 326 | syslog_r(pri, &sdata, "%.500s", fmtbuf); |
327 | closelog_r(&sdata); | 327 | closelog_r(&sdata); |