From 2fba82d69e6993d08ad8658313b8e6eaadb79d1c Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Sun, 24 Feb 2013 08:46:48 -0500 Subject: [PATCH] sysdeps: Don't use LOG_PERROR if systemd is booted Otherwise we get duplicated log output, since stdout/stderr are connected to the journal by default. --- dbus/dbus-sysdeps-util-unix.c | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/dbus/dbus-sysdeps-util-unix.c b/dbus/dbus-sysdeps-util-unix.c index 7beab20..fe8843f 100644 --- a/dbus/dbus-sysdeps-util-unix.c +++ b/dbus/dbus-sysdeps-util-unix.c @@ -429,13 +429,16 @@ void _dbus_init_system_log (void) { #ifdef HAVE_SYSLOG_H + int logopts = LOG_PID; -#if HAVE_DECL_LOG_PERROR - openlog ("dbus", LOG_PID | LOG_PERROR, LOG_DAEMON); -#else - openlog ("dbus", LOG_PID, LOG_DAEMON); +#ifdef HAVE_DECL_LOG_PERROR +#ifdef HAVE_SYSTEMD + if (sd_booted () <= 0) +#endif + logopts |= LOG_PERROR; #endif + openlog ("dbus", logopts, LOG_DAEMON); #endif } -- 1.7.1