#include <sys/socket.h>
#include <dirent.h>
#include <sys/un.h>
+
+#ifdef HAVE_SYSLOG_H
#include <syslog.h>
+#endif
#ifdef HAVE_SYS_SYSLIMITS_H
#include <sys/syslimits.h>
void
_dbus_init_system_log (void)
{
+#ifdef HAVE_SYSLOG_H
+
#if HAVE_DECL_LOG_PERROR
openlog ("dbus", LOG_PID | LOG_PERROR, LOG_DAEMON);
#else
openlog ("dbus", LOG_PID, LOG_DAEMON);
#endif
+
+#endif
}
/**
void
_dbus_system_logv (DBusSystemLogSeverity severity, const char *msg, va_list args)
{
+#ifdef HAVE_SYSLOG_H
int flags;
switch (severity)
{
return;
}
-#ifndef HAVE_DECL_LOG_PERROR
+ vsyslog (flags, msg, args);
+#endif
+
+#if !defined(HAVE_SYSLOG_H) || !HAVE_DECL_LOG_PERROR
{
/* vsyslog() won't write to stderr, so we'd better do it */
va_list tmp;
}
#endif
- vsyslog (flags, msg, args);
-
if (severity == DBUS_SYSTEM_LOG_FATAL)
exit (1);
}