From: Ralf Habacker Date: Fri, 10 Feb 2017 12:10:49 +0000 (+0100) Subject: Only print timestamps on stderr if verbose messages will go there X-Git-Tag: dbus-1.11.10~36 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ca75dee7858c95a6366ca30ef9af029d88c49a0f;p=thirdparty%2Fdbus.git 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 --- 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);