diff options
author | Colin Walters <walters@verbum.org> | 2013-02-24 08:46:48 -0500 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2013-02-25 19:36:17 -0500 |
commit | 88642f6fee46a4c6d1fde8ae221494a6b3188bd4 (patch) | |
tree | 2ad0b3eedd7240c5663338d15292cb087b15ac2b /dbus/dbus-sysdeps-util-unix.c | |
parent | 4d41d120d8240cbf78cee5e0ab6bad79eab914c1 (diff) | |
download | dbus-88642f6fee46a4c6d1fde8ae221494a6b3188bd4.tar.gz |
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.
https://bugs.freedesktop.org/show_bug.cgi?id=61399
Diffstat (limited to 'dbus/dbus-sysdeps-util-unix.c')
-rw-r--r-- | 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 7beab209..fe8843f1 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 } |