[PATCH]: adapt to new DBusWatch api

Jouni Malinen j at w1.fi
Sun Nov 4 21:11:30 EST 2007

On Sun, Nov 04, 2007 at 08:26:19AM +1000, Kel Modderman wrote:

> 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)

> The DBusWatch api has tagged dbus_watch_get_fd as deprecated in favour of
> dbus_watch_get_unix_fd [0].
> [0] http://dbus.freedesktop.org/doc/api/html/group__DBusWatch.html

When was this deprecated? The header files I have on my system (dbus
1.0.2) do not have any notes on it being deprecated. The web page is
stating that it is deprecated, but that would not show up in compilation
results.. Based on NEWS file from dbus-1.1.2, this was done in D-Bus
1.1.1 which is a development release. Is that version (or 1.1.2 for that
matter) being deployed in some distros already?

> 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.

> -       fd = dbus_watch_get_fd(watch);
> +       fd = dbus_watch_get_unix_fd(watch);

dbus_watch_get_unix_fd() does not seem to be available in dbus 0.90
("API/ABI freeze for 1.0" in change log), 1.0.0, or even 1.0.2. In other
words, I don't think it is available in any stable dbus release and as
such, this patch would break a lot (most?) of existing systems and I
don't think I can apply this change at this point.

If there is no DBUS_VERSION_* macro that changes between dbus 1.0.x and
1.1.x (or well, 1.2.x, once the stable release becomes available) and
the API is changes, someone better try to get dbus maintainers to fix
this.. There really needs to be a compile time mechanism for #ifdef'ing
this properly.

Jouni Malinen                                            PGP id EFC895FA

More information about the HostAP mailing list