summaryrefslogtreecommitdiffstats
path: root/log.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2004-02-18 12:59:43 +0100
committerDamien Miller <djm@mindrot.org>2004-02-18 12:59:43 +0100
commit051b0acbbce7218dcfa1521ad22f860aa20b3008 (patch)
treea768f24c43b82654fc0684b5ac30be541b1ff21c /log.c
parent - (djm) [log.c] Correct use of HAVE_OPENLOG_R (diff)
downloadopenssh-051b0acbbce7218dcfa1521ad22f860aa20b3008.tar.xz
openssh-051b0acbbce7218dcfa1521ad22f860aa20b3008.zip
- (djm) [log.c] Tighten openlog_r tests
Diffstat (limited to 'log.c')
-rw-r--r--log.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/log.c b/log.c
index e4ea99589..0c4d5123a 100644
--- a/log.c
+++ b/log.c
@@ -265,7 +265,7 @@ log_init(char *av0, LogLevel level, SyslogFacility facility, int on_stderr)
void
do_log(LogLevel level, const char *fmt, va_list args)
{
-#ifdef HAVE_OPENLOG_R
+#if defined(HAVE_OPENLOG_R) && defined(SYSLOG_DATA_INIT)
struct syslog_data sdata = SYSLOG_DATA_INIT;
#endif
char msgbuf[MSGBUFSIZ];
@@ -321,7 +321,7 @@ do_log(LogLevel level, const char *fmt, va_list args)
snprintf(msgbuf, sizeof msgbuf, "%s\r\n", fmtbuf);
write(STDERR_FILENO, msgbuf, strlen(msgbuf));
} else {
-#ifdef HAVE_OPENLOG_R
+#if defined(HAVE_OPENLOG_R) && defined(SYSLOG_DATA_INIT)
openlog_r(argv0 ? argv0 : __progname, LOG_PID, log_facility, &sdata);
syslog_r(pri, &sdata, "%.500s", fmtbuf);
closelog_r(&sdata);