X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=avahi-daemon%2Fdbus-protocol.c;h=242ad59028c5363b03779a544851782d62a27939;hb=22616538ec2fd1926babb3e6dd60cb6775974252;hp=501706136d98338bd0bd8495de995ae3ef072840;hpb=514a726560b8e8582abff7ccbc6e69ade5cdb04a;p=catta 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 + +#ifdef HAVE_CONFIG_H +#include +#endif + #define DBUS_API_SUBJECT_TO_CHANGE #include #include @@ -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)) {