summaryrefslogtreecommitdiff
path: root/dbus/dbus-sysdeps-util-unix.c
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2011-09-21 11:39:32 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2011-09-21 11:39:32 +0100
commitbf3d8259ac89ee4fe86b3f9e6df71f6e71e07fd2 (patch)
treed80925fcf3feaa14b9e7eed571d0ce9e3cf53efc /dbus/dbus-sysdeps-util-unix.c
parentc1989c1a4f013085fe5eceb6bffa89d1e1b66bf5 (diff)
parentbdfec550544d353e60228b0553534467cbb36a06 (diff)
downloaddbus-bf3d8259ac89ee4fe86b3f9e6df71f6e71e07fd2.tar.gz
Merge branch 'dbus-1.4'
Conflicts: NEWS
Diffstat (limited to 'dbus/dbus-sysdeps-util-unix.c')
-rw-r--r--dbus/dbus-sysdeps-util-unix.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/dbus/dbus-sysdeps-util-unix.c b/dbus/dbus-sysdeps-util-unix.c
index 805c919d..a1915cb3 100644
--- a/dbus/dbus-sysdeps-util-unix.c
+++ b/dbus/dbus-sysdeps-util-unix.c
@@ -421,11 +421,16 @@ _dbus_request_file_descriptor_limit (unsigned int limit)
#endif
}
-void
+void
_dbus_init_system_log (void)
{
+#ifdef HAVE_DECL_LOG_PERROR
openlog ("dbus", LOG_PID | LOG_PERROR, LOG_DAEMON);
+#else
+ openlog ("dbus", LOG_PID, LOG_DAEMON);
+#endif
}
+
/**
* Log a message to the system log file (e.g. syslog on Unix).
*
@@ -475,6 +480,19 @@ _dbus_system_logv (DBusSystemLogSeverity severity, const char *msg, va_list args
return;
}
+#ifndef HAVE_DECL_LOG_PERROR
+ {
+ /* vsyslog() won't write to stderr, so we'd better do it */
+ va_list tmp;
+
+ DBUS_VA_COPY (tmp, args);
+ fprintf (stderr, "dbus[" DBUS_PID_FORMAT "]: ", _dbus_getpid ());
+ vfprintf (stderr, msg, tmp);
+ fputc ('\n', stderr);
+ va_end (tmp);
+ }
+#endif
+
vsyslog (flags, msg, args);
if (severity == DBUS_SYSTEM_LOG_FATAL)