From ca75dee7858c95a6366ca30ef9af029d88c49a0f Mon Sep 17 00:00:00 2001 From: Ralf Habacker Date: Fri, 10 Feb 2017 13:10:49 +0100 Subject: [PATCH] Only print timestamps on stderr if verbose messages will go there On Windows, dbus can be configured to send DBUS_VERBOSE messages to the Windows debug port instead of stderr. If we're in that configuration, we already avoided printing thread information to stderr before each verbose message; do the same for timestamps. Reviewed-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99749 --- dbus/dbus-internals.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dbus/dbus-internals.c b/dbus/dbus-internals.c index 9e515da1b..1fb6f02e0 100644 --- a/dbus/dbus-internals.c +++ b/dbus/dbus-internals.c @@ -395,7 +395,6 @@ _dbus_verbose_real ( static dbus_bool_t need_pid = TRUE; int len; long sec, usec; - _dbus_get_real_time (&sec, &usec); /* things are written a bit oddly here so that * in the non-verbose case we just have the one @@ -410,8 +409,9 @@ _dbus_verbose_real ( { _dbus_print_thread (); } -#endif + _dbus_get_real_time (&sec, &usec); fprintf (stderr, "%ld.%06ld ", sec, usec); +#endif /* Only print pid again if the next line is a new line */ len = strlen (format); -- 2.47.3