From c8808e3acd55fea9f667efaf9f51b6c3ef094713 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Fri, 21 Dec 2012 09:58:52 +0200 Subject: [PATCH] network: Fix bnep_send_conn_req error checking --- profiles/network/connection.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/profiles/network/connection.c b/profiles/network/connection.c index 4b30aa3d6..671478cc7 100644 --- a/profiles/network/connection.c +++ b/profiles/network/connection.c @@ -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, -- 2.11.0