[PATCH]: adapt to new DBusWatch api

Kel Modderman kel
Sat Nov 3 15:26:19 PDT 2007


Hi,

Concerning the following compile warnings:

ctrl_iface_dbus.c: In function 'connection_setup_add_watch':
ctrl_iface_dbus.c:86: warning: 'dbus_watch_get_fd' is deprecated (declared 
at /usr/include/dbus-1.0/dbus/dbus-connection.h:357)
ctrl_iface_dbus.c: In function 'connection_setup_remove_watch':
ctrl_iface_dbus.c:111: warning: 'dbus_watch_get_fd' is deprecated (declared 
at /usr/include/dbus-1.0/dbus/dbus-connection.h:357)

The DBusWatch api has tagged dbus_watch_get_fd as deprecated in favour of
dbus_watch_get_unix_fd [0].

Attached patch directly changes to this api, as I cannot think of sane way to
add compile time test of DBUS_VERSION_* or the like.

[0] http://dbus.freedesktop.org/doc/api/html/group__DBusWatch.html
---
--- a/wpa_supplicant/ctrl_iface_dbus.c
+++ b/wpa_supplicant/ctrl_iface_dbus.c
@@ -83,7 +83,7 @@ static void connection_setup_add_watch(struct 
ctrl_iface_dbus_priv *iface,
                return;

        flags = dbus_watch_get_flags(watch);
-       fd = dbus_watch_get_fd(watch);
+       fd = dbus_watch_get_unix_fd(watch);

        eloop_register_sock(fd, EVENT_TYPE_EXCEPTION, process_watch_exception,
                            iface, watch);
@@ -108,7 +108,7 @@ static void connection_setup_remove_watch(struct 
ctrl_iface_dbus_priv *iface,
        int fd;

        flags = dbus_watch_get_flags(watch);
-       fd = dbus_watch_get_fd(watch);
+       fd = dbus_watch_get_unix_fd(watch);

        eloop_unregister_sock(fd, EVENT_TYPE_EXCEPTION);





More information about the Hostap mailing list