From 12b3931b36119a676823c6c41c051bc4f328b0c2 Mon Sep 17 00:00:00 2001 From: Ralf Habacker Date: Mon, 16 Feb 2015 13:54:39 +0100 Subject: [PATCH 2/5] dbus-monitor: Combine sec and usec columns into one timestamp column and unify platform related format string. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89165 --- tools/dbus-monitor.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/tools/dbus-monitor.c b/tools/dbus-monitor.c index 33414c9..3045aa8 100644 --- a/tools/dbus-monitor.c +++ b/tools/dbus-monitor.c @@ -107,14 +107,6 @@ monitor_filter_func (DBusConnection *connection, return DBUS_HANDLER_RESULT_HANDLED; } -#ifdef __APPLE__ -#define PROFILE_TIMED_FORMAT "%s\t%lu\t%d" -#elif defined(__NetBSD__) -#include -#define PROFILE_TIMED_FORMAT "%s\t%" PRId64 "\t%d" -#else -#define PROFILE_TIMED_FORMAT "%s\t%lu\t%lu" -#endif #define TRAP_NULL_STRING(str) ((str) ? (str) : "") typedef enum @@ -140,7 +132,7 @@ static void profile_print_with_attrs (const char *type, DBusMessage *message, struct timeval *t, ProfileAttributeFlags attrs) { - printf (PROFILE_TIMED_FORMAT, type, t->tv_sec, t->tv_usec); + printf ("%s\t%lu.%06lu", type, (unsigned long) t->tv_sec, (unsigned long) t->tv_usec); if (attrs & PROFILE_ATTRIBUTE_FLAG_SERIAL) printf ("\t%u", dbus_message_get_serial (message)); @@ -224,7 +216,7 @@ print_message_profile (DBusMessage *message) PROFILE_ATTRIBUTE_FLAG_MEMBER); break; default: - printf (PROFILE_TIMED_FORMAT "\n", "tun", t.tv_sec, t.tv_usec); + printf ("%s\t%lu.%06lu", "tun", (unsigned long) t.tv_sec, (unsigned long) t.tv_usec); break; } } -- 1.8.4.5