Directly use preferred or service lists instead of the more complicated
current version which is a leftover from the age of GSequences.

The functionality of the code is the same as before.
---
 src/service.c |   19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/src/service.c b/src/service.c
index fe1d23c..9bb2f04 100644
--- a/src/service.c
+++ b/src/service.c
@@ -3499,24 +3499,21 @@ static bool auto_connect_service(GList *services, bool 
preferred)
 
 static gboolean run_auto_connect(gpointer data)
 {
-       GList *list = NULL, *preferred_tech;
+       bool autoconnecting = false;
+       GList *preferred_tech;
 
        autoconnect_timeout = 0;
 
        DBG("");
 
        preferred_tech = preferred_tech_list_get();
-       if (preferred_tech)
-               list = preferred_tech;
-
-       if (!list || !auto_connect_service(list, true))
-               list = service_list;
-
-       if (list)
-               auto_connect_service(list, false);
-
-       if (preferred_tech)
+       if (preferred_tech) {
+               autoconnecting = auto_connect_service(preferred_tech, true);
                g_list_free(preferred_tech);
+       }
+
+       if (!autoconnecting)
+               auto_connect_service(service_list, false);
 
        return FALSE;
 }
-- 
1.7.10.4

_______________________________________________
connman mailing list
[email protected]
https://lists.connman.net/mailman/listinfo/connman

Reply via email to