summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2010-03-22 14:33:37 -0400
committerColin Walters <walters@verbum.org>2010-03-22 14:35:28 -0400
commit3861cb42f437a9eb2b13c5c2aa4081268c45c32c (patch)
tree046185cc46d19d46686da99950bd3304aee959d6
parentc93d3ec2ff13f31291c56f6d5d4f7a77ecdb5ea7 (diff)
downloaddbus-3861cb42f437a9eb2b13c5c2aa4081268c45c32c.tar.gz
[64 bit printf] Update to use DBUS_PID_FORMAT, print (omitted)
There were already defines for formatting pids and uids, so use those. In the case where we don't have a format specifier for 64 bit, print (omitted) in dbus-monitor.
-rw-r--r--dbus/dbus-credentials.c4
-rw-r--r--tools/dbus-print-message.c8
2 files changed, 8 insertions, 4 deletions
diff --git a/dbus/dbus-credentials.c b/dbus/dbus-credentials.c
index 50a0548a..ff69f3b0 100644
--- a/dbus/dbus-credentials.c
+++ b/dbus/dbus-credentials.c
@@ -519,13 +519,13 @@ _dbus_credentials_to_string_append (DBusCredentials *credentials,
join = FALSE;
if (credentials->unix_uid != DBUS_UID_UNSET)
{
- if (!_dbus_string_append_printf (string, "uid=%d", (int) credentials->unix_uid))
+ if (!_dbus_string_append_printf (string, "uid=" DBUS_UID_FORMAT, credentials->unix_uid))
goto oom;
join = TRUE;
}
if (credentials->unix_pid != DBUS_PID_UNSET)
{
- if (!_dbus_string_append_printf (string, "%spid=%d", join ? " " : "", (int) credentials->unix_pid))
+ if (!_dbus_string_append_printf (string, "%spid=" DBUS_PID_FORMAT, join ? " " : "", credentials->unix_pid))
goto oom;
join = TRUE;
}
diff --git a/tools/dbus-print-message.c b/tools/dbus-print-message.c
index cac40410..fac5cc1f 100644
--- a/tools/dbus-print-message.c
+++ b/tools/dbus-print-message.c
@@ -227,7 +227,9 @@ print_iter (DBusMessageIter *iter, dbus_bool_t literal, int depth)
dbus_int64_t val;
dbus_message_iter_get_basic (iter, &val);
#ifdef DBUS_INT64_PRINTF_MODIFIER
- printf ("int64 %" DBUS_INT64_PRINTF_MODIFIER "d\n", val);
+ printf ("int64 %" DBUS_INT64_PRINTF_MODIFIER "d\n", val);
+#else
+ printf ("int64 (omitted)\n");
#endif
break;
}
@@ -237,7 +239,9 @@ print_iter (DBusMessageIter *iter, dbus_bool_t literal, int depth)
dbus_uint64_t val;
dbus_message_iter_get_basic (iter, &val);
#ifdef DBUS_INT64_PRINTF_MODIFIER
- printf ("uint64 %" DBUS_INT64_PRINTF_MODIFIER "u\n", val);
+ printf ("uint64 %" DBUS_INT64_PRINTF_MODIFIER "u\n", val);
+#else
+ printf ("uint64 (omitted)\n");
#endif
break;
}