summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2009-05-06 16:11:49 +0300
committerJohan Hedberg <johan.hedberg@nokia.com>2009-05-06 16:13:59 +0300
commit09cd069379a5fa25af7c9d31131882de05375ae1 (patch)
tree7c63a460df163f693d8d6aa093b53fdbae418574
parent4e71ac8617182584edf8ca57879e33d98879eb5d (diff)
downloadbluez-09cd069379a5fa25af7c9d31131882de05375ae1.tar.gz
Fix service classes race condition upon starting bluetoothd
During initial startup if InitiallyPowered=false we might not get the "write class of device complete" HCI event before bluetoothd puts the adapter DOWN. In this case the correct class never gets written to storage but stays in adapter->svc_cache instead. This patch makes sure that the right class is always set in adapter_up().
-rw-r--r--src/adapter.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/adapter.c b/src/adapter.c
index aad51e3e1..65ac36aaf 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -2082,11 +2082,12 @@ proceed:
adapter->initialized = TRUE;
- adapter_update(adapter, 0, FALSE);
-
manager_add_adapter(adapter->path);
}
+ if (adapter->svc_cache)
+ adapter_update(adapter, 0, FALSE);
+
if (dev_down) {
adapter_ops->stop(adapter->dev_id);
adapter->off_requested = TRUE;