summaryrefslogtreecommitdiffstats
path: root/avahi-daemon/dbus-protocol.c
diff options
context:
space:
mode:
authorTrent Lloyd <lathiat@bur.st>2005-06-17 18:44:39 +0000
committerTrent Lloyd <lathiat@bur.st>2005-06-17 18:44:39 +0000
commit964e9764b0ea8a7580bbdecb40ac2b89f4d2858c (patch)
tree784537e596af3bf8a2a704f6b1749e5aecb12644 /avahi-daemon/dbus-protocol.c
parent6d4a9b90e98a98e5bb28289595558af745dbeed3 (diff)
* make the daemon build with dbus on both 0.23 and 0.30+, it doesn't yet work properly on 0.30 but it builds and runs
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@126 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'avahi-daemon/dbus-protocol.c')
-rw-r--r--avahi-daemon/dbus-protocol.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/avahi-daemon/dbus-protocol.c b/avahi-daemon/dbus-protocol.c
index 5017061..242ad59 100644
--- a/avahi-daemon/dbus-protocol.c
+++ b/avahi-daemon/dbus-protocol.c
@@ -20,6 +20,11 @@
***/
#include <glib.h>
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#define DBUS_API_SUBJECT_TO_CHANGE
#include <dbus/dbus.h>
#include <dbus/dbus-glib-lowlevel.h>
@@ -67,7 +72,11 @@ signal_filter (DBusConnection *conn, DBusMessage *message, void *user_data)
dbus_message_get_member (message));
if (dbus_message_is_signal (message,
+#ifdef DBUS_USE_NEW_API
+ DBUS_INTERFACE_LOCAL,
+#else
DBUS_INTERFACE_ORG_FREEDESKTOP_LOCAL,
+#endif
"Disconnected"))
{
/* No, we shouldn't quit, but until we get somewhere
@@ -81,7 +90,11 @@ signal_filter (DBusConnection *conn, DBusMessage *message, void *user_data)
{
return do_register (conn, message);
} else if (dbus_message_is_signal (message,
+#ifdef DBUS_USE_NEW_API
+ DBUS_INTERFACE_DBUS,
+#else
DBUS_INTERFACE_ORG_FREEDESKTOP_DBUS,
+#endif
"ServiceAcquired"))
{
char *name;
@@ -128,7 +141,11 @@ dbus_protocol_setup (GMainLoop *loop)
dbus_connection_setup_with_g_main (bus, NULL);
dbus_connection_set_exit_on_disconnect (bus, FALSE);
+#ifdef DBUS_USE_NEW_API
+ dbus_bus_request_name (bus, DBUS_SERVICE_AVAHI, 0, &error);
+#else
dbus_bus_acquire_service (bus, DBUS_SERVICE_AVAHI, 0, &error);
+#endif
if (dbus_error_is_set (&error))
{