bluetooth: Fix possible adapter duplicates
authorMikel Astiz <mikel.astiz@bmw-carit.de>
Sun, 17 Feb 2013 09:04:16 +0000 (10:04 +0100)
committerTanu Kaskinen <tanuk@iki.fi>
Mon, 18 Feb 2013 17:50:37 +0000 (19:50 +0200)
commit90ae7775002ba75cb890f14e15653e42ebecce35
treeff959f5a8b9632708bad7b01038cb70ffc1bb31d
parent163430f05bc763a77d510758781cea57ef919ad6
bluetooth: Fix possible adapter duplicates

The D-Bus signal AdapterAdded can be received during our call to
GetProperties(), before the reply is received. In this case, the adapter
will be listed twice and thus the endpoint registration will fail with
"AlreadyExists" as follows:

D: [pulseaudio] bluetooth-util.c: dbus: interface=org.bluez.Manager, path=/, member=AdapterAdded
D: [pulseaudio] bluetooth-util.c: Adapter /org/bluez/21220/hci0 created
D: [pulseaudio] bluetooth-util.c: Registering /MediaEndpoint/HFPAG on adapter /org/bluez/21220/hci0.
D: [pulseaudio] bluetooth-util.c: Registering /MediaEndpoint/HFPHS on adapter /org/bluez/21220/hci0.
D: [pulseaudio] bluetooth-util.c: Registering /MediaEndpoint/A2DPSource on adapter /org/bluez/21220/hci0.
D: [pulseaudio] bluetooth-util.c: Registering /MediaEndpoint/A2DPSink on adapter /org/bluez/21220/hci0.
D: [pulseaudio] bluetooth-util.c: Registering /MediaEndpoint/HFPAG on adapter /org/bluez/21220/hci0.
D: [pulseaudio] bluetooth-util.c: Registering /MediaEndpoint/HFPHS on adapter /org/bluez/21220/hci0.
D: [pulseaudio] bluetooth-util.c: Registering /MediaEndpoint/A2DPSource on adapter /org/bluez/21220/hci0.
D: [pulseaudio] bluetooth-util.c: Registering /MediaEndpoint/A2DPSink on adapter /org/bluez/21220/hci0.
E: [pulseaudio] bluetooth-util.c: RegisterEndpoint() failed: org.bluez.Error.AlreadyExists: Already Exists
E: [pulseaudio] bluetooth-util.c: RegisterEndpoint() failed: org.bluez.Error.AlreadyExists: Already Exists
E: [pulseaudio] bluetooth-util.c: RegisterEndpoint() failed: org.bluez.Error.AlreadyExists: Already Exists
E: [pulseaudio] bluetooth-util.c: RegisterEndpoint() failed: org.bluez.Error.AlreadyExists: Already Exists
src/modules/bluetooth/bluetooth-util.c