Diff between f0b7c11ad7b2240738f0ab99c258954cbe00dc77 and 3aa815a31017e8793b030b04ef704ce85455b9aa

Changed Files

File Additions Deletions Status
src/device.c +10 -6 modified

Full Patch

diff --git a/src/device.c b/src/device.c
index a8d9534..c2de7b3 100644
--- a/src/device.c
+++ b/src/device.c
@@ -1626,15 +1626,19 @@ done:
 	if (!dev->connect)
 		return;
 
-	if (!err && dbus_message_is_method_call(dev->connect, DEVICE_INTERFACE,
-								"Connect"))
-		dev->general_connect = TRUE;
+	if (dbus_message_is_method_call(dev->connect, DEVICE_INTERFACE,
+							"Connect")) {
+		if (!err)
+			dev->general_connect = TRUE;
+		else if (!find_service_with_state(dev->services,
+						BTD_SERVICE_STATE_CONNECTED))
+			/* Reset error if there are services connected */
+			err = 0;
+	}
 
 	DBG("returning response to %s", dbus_message_get_sender(dev->connect));
 
-	l = find_service_with_state(dev->services, BTD_SERVICE_STATE_CONNECTED);
-
-	if (err && l == NULL) {
+	if (err) {
 		/* Fallback to LE bearer if supported */
 		if (err == -EHOSTDOWN && dev->le && !dev->le_state.connected) {
 			err = device_connect_le(dev);