OSDN Git Service

network: Fix bnep_send_conn_req error checking
authorJohan Hedberg <johan.hedberg@intel.com>
Fri, 21 Dec 2012 07:58:52 +0000 (09:58 +0200)
committerJohan Hedberg <johan.hedberg@intel.com>
Fri, 21 Dec 2012 08:03:32 +0000 (10:03 +0200)
profiles/network/connection.c

index 4b30aa3..671478c 100644 (file)
@@ -349,7 +349,7 @@ static gboolean bnep_conn_req_to(gpointer user_data)
                error("Too many bnep connection attempts");
        } else {
                error("bnep connection setup TO, retrying...");
-               if (!bnep_send_conn_req(nc))
+               if (bnep_send_conn_req(nc) == 0)
                        return TRUE;
        }
 
@@ -363,7 +363,9 @@ static int bnep_connect(struct network_conn *nc)
        int err;
 
        nc->attempt_cnt = 0;
-       if ((err = bnep_send_conn_req(nc)))
+
+       err = bnep_send_conn_req(nc);
+       if (err < 0)
                return err;
 
        nc->timeout_source = g_timeout_add_seconds(CON_SETUP_TO,