Diff between c73c1002331b2c0de0eaf555b5f1d05149f9a3b0 and 39b9e120eb6e85f18e67679b4c3fe2823ba4c92d

Changed Files

File Additions Deletions Status
src/profile.c +7 -2 modified

Full Patch

diff --git a/src/profile.c b/src/profile.c
index 4e68afc..4b73026 100644
--- a/src/profile.c
+++ b/src/profile.c
@@ -797,8 +797,13 @@ static gboolean ext_io_disconnected(GIOChannel *io, GIOCondition cond,
 
 	DBG("%s disconnected from %s", ext->name, addr);
 drop:
-	if (conn->service)
-		btd_service_disconnecting_complete(conn->service, 0);
+	if (conn->service) {
+		if (btd_service_get_state(conn->service) ==
+						BTD_SERVICE_STATE_CONNECTING)
+			btd_service_connecting_complete(conn->service, -EIO);
+		else
+			btd_service_disconnecting_complete(conn->service, 0);
+	}
 
 	ext->conns = g_slist_remove(ext->conns, conn);
 	ext_io_destroy(conn);