]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
dbus: switch dbus APIs initialization order
authorWitold Sowa <witold.sowa@gmail.com>
Thu, 3 Dec 2009 19:17:49 +0000 (21:17 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 3 Dec 2009 19:17:49 +0000 (21:17 +0200)
Initialize the new DBus API before the old one, so new applications
which can use both, the old and the new API will be notified first
that new API is available.

wpa_supplicant/notify.c

index 7ebe8b6e941f2fda09419895e7813b68a4778029..aa3d54878a70671d5ac7984639e05cde2e262a46 100644 (file)
@@ -27,17 +27,17 @@ int wpas_notify_supplicant_initialized(struct wpa_global *global)
        struct wpas_dbus_callbacks *cbs = wpas_dbus_get_callbacks();
 
        if (global->params.dbus_ctrl_interface) {
-               global->dbus_ctrl_iface =
-                       wpa_supplicant_dbus_ctrl_iface_init(global);
-               if (global->dbus_ctrl_iface == NULL)
-                       return -1;
-
                if (cbs) {
                        global->dbus_new_ctrl_iface =
                                cbs->dbus_ctrl_init(global);
                        if (global->dbus_new_ctrl_iface == NULL)
                                return -1;
                }
+
+               global->dbus_ctrl_iface =
+                       wpa_supplicant_dbus_ctrl_iface_init(global);
+               if (global->dbus_ctrl_iface == NULL)
+                       return -1;
        }
 
        return 0;
@@ -48,11 +48,11 @@ void wpas_notify_supplicant_deinitialized(struct wpa_global *global)
 {
        struct wpas_dbus_callbacks *cbs = wpas_dbus_get_callbacks();
 
-       if (global->dbus_ctrl_iface)
-               wpa_supplicant_dbus_ctrl_iface_deinit(global->dbus_ctrl_iface);
-
        if (cbs && global->dbus_new_ctrl_iface)
                cbs->dbus_ctrl_deinit(global->dbus_new_ctrl_iface);
+
+       if (global->dbus_ctrl_iface)
+               wpa_supplicant_dbus_ctrl_iface_deinit(global->dbus_ctrl_iface);
 }