summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrent Lloyd <lathiat@bur.st>2006-11-11 00:00:20 +0000
committerTrent Lloyd <lathiat@bur.st>2006-11-11 00:00:20 +0000
commit2d332e78d4e78eee19f03fb6ec4db2983591c022 (patch)
treedc99bf439017cbe8b175930e4c8bfff20781d7ed
parent71ef4b773ae4cc737dde645b76b8ffa0ace227e5 (diff)
Make d-bus version detection work for >= 1.0 (Closes: #71)
Dont dbus_connection_close on shared dbus connections (Closes: #68) git-svn-id: file:///home/lennart/svn/public/avahi/trunk@1333 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
-rw-r--r--avahi-daemon/dbus-protocol.c21
1 files changed, 3 insertions, 18 deletions
diff --git a/avahi-daemon/dbus-protocol.c b/avahi-daemon/dbus-protocol.c
index dbf30f8..caa2e19 100644
--- a/avahi-daemon/dbus-protocol.c
+++ b/avahi-daemon/dbus-protocol.c
@@ -1067,10 +1067,10 @@ static int dbus_connect(void) {
if (dbus_bus_request_name(
server->bus,
AVAHI_DBUS_NAME,
-#if (DBUS_VERSION_MAJOR == 0) && (DBUS_VERSION_MINOR >= 60)
- DBUS_NAME_FLAG_DO_NOT_QUEUE,
-#else
+#if (DBUS_VERSION_MAJOR == 0) && (DBUS_VERSION_MINOR < 60)
DBUS_NAME_FLAG_PROHIBIT_REPLACEMENT,
+#else
+ DBUS_NAME_FLAG_DO_NOT_QUEUE,
#endif
&error) != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER) {
if (dbus_error_is_set(&error)) {
@@ -1106,11 +1106,6 @@ fail:
dbus_error_free(&error);
if (server->bus) {
-#ifdef HAVE_DBUS_CONNECTION_CLOSE
- dbus_connection_close(server->bus);
-#else
- dbus_connection_disconnect(server->bus);
-#endif
dbus_connection_unref(server->bus);
server->bus = NULL;
}
@@ -1127,11 +1122,6 @@ static void dbus_disconnect(void) {
assert(server->n_clients == 0);
if (server->bus) {
-#ifdef HAVE_DBUS_CONNECTION_CLOSE
- dbus_connection_close(server->bus);
-#else
- dbus_connection_disconnect(server->bus);
-#endif
dbus_connection_unref(server->bus);
server->bus = NULL;
}
@@ -1166,11 +1156,6 @@ int dbus_protocol_setup(const AvahiPoll *poll_api, int _disable_user_service_pub
fail:
if (server->bus) {
-#ifdef HAVE_DBUS_CONNECTION_CLOSE
- dbus_connection_close(server->bus);
-#else
- dbus_connection_disconnect(server->bus);
-#endif
dbus_connection_unref(server->bus);
}