diff options
author | Rodrigo Moya <rodrigo.moya@collabora.co.uk> | 2012-06-06 16:16:36 +0200 |
---|---|---|
committer | Rodrigo Moya <rodrigo@gnome-db.org> | 2012-06-06 16:16:36 +0200 |
commit | 4d1c2058ce178e7ec445c294377b1b2f5929d219 (patch) | |
tree | 28c146970d9862cb68320b36afa5e973ec0c6f59 | |
parent | 12aabb859e7814502ea26f8e537b6a5f13ffdaa6 (diff) | |
download | dbus-4d1c2058ce178e7ec445c294377b1b2f5929d219.tar.gz |
With AF_BUS, use the peer address as unique name
-rw-r--r-- | bus/driver-afbus.c | 5 | ||||
-rw-r--r-- | bus/driver.c | 16 |
2 files changed, 9 insertions, 12 deletions
diff --git a/bus/driver-afbus.c b/bus/driver-afbus.c index 507a19a6..62c2938b 100644 --- a/bus/driver-afbus.c +++ b/bus/driver-afbus.c @@ -224,9 +224,6 @@ bus_driver_afbus_append_unique_name (DBusConnection *connection, if (!_dbus_string_append_uint (str, address.sbus_addr.s_addr)) return FALSE; - if (!_dbus_string_append (str, ".")) - return FALSE; - return TRUE; } @@ -290,7 +287,7 @@ bus_driver_afbus_assign_address (DBusConnection *connection) struct sockaddr_bus address; long len = sizeof (address); int fd; - static unsigned long long next_address = 0x1111000000000001; + static dbus_uint64_t next_address = 0x1111000000000001ULL; memset (&address, 0, sizeof (address)); if (!dbus_connection_get_peer_address (connection, &address, &len) || diff --git a/bus/driver.c b/bus/driver.c index d776e2cc..11767c8c 100644 --- a/bus/driver.c +++ b/bus/driver.c @@ -223,16 +223,16 @@ create_unique_client_name (DBusConnection *connection, return FALSE; if (!bus_driver_afbus_append_unique_name (connection, str)) - return FALSE; - - if (!_dbus_string_append_int (str, next_major_number)) - return FALSE; + { + if (!_dbus_string_append_int (str, next_major_number)) + return FALSE; - if (!_dbus_string_append (str, ".")) - return FALSE; + if (!_dbus_string_append (str, ".")) + return FALSE; - if (!_dbus_string_append_int (str, next_minor_number)) - return FALSE; + if (!_dbus_string_append_int (str, next_minor_number)) + return FALSE; + } next_minor_number += 1; |