Diff between 451d48de3fc63ddc88e505c1a4b645c40af88ea5 and eddab0c4259a79314a5f8671b8d52198719d0b85

Changed Files

File Additions Deletions Status
plugins/mgmtops.c +6 -5 modified

Full Patch

diff --git a/plugins/mgmtops.c b/plugins/mgmtops.c
index c060ada..27cec09 100644
--- a/plugins/mgmtops.c
+++ b/plugins/mgmtops.c
@@ -1072,11 +1072,12 @@ static void read_info_complete(int sk, uint16_t index, void *buf, size_t len)
 		return;
 	}
 
-	if (mode != MODE_OFF && !mgmt_powered(info->current_settings))
-		mgmt_set_powered(index, TRUE);
-	else {
-		get_connections(sk, index);
-		btd_adapter_start(adapter);
+	if (mode != MODE_OFF) {
+		if (mgmt_powered(info->current_settings)) {
+			get_connections(sk, index);
+			btd_adapter_start(adapter);
+		} else
+			mgmt_set_powered(index, TRUE);
 	}
 
 	btd_adapter_unref(adapter);