summaryrefslogtreecommitdiffstats
path: root/binding/bluetooth-util.c
diff options
context:
space:
mode:
Diffstat (limited to 'binding/bluetooth-util.c')
-rw-r--r--binding/bluetooth-util.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/binding/bluetooth-util.c b/binding/bluetooth-util.c
index e8a0781..f07e5ed 100644
--- a/binding/bluetooth-util.c
+++ b/binding/bluetooth-util.c
@@ -1040,10 +1040,13 @@ void json_process_path(json_object *jresp, const char *path) {
}
gchar *return_bluez_path(afb_req_t request) {
+ struct bluetooth_state *ns = bluetooth_get_userdata(request);
const char *adapter = afb_req_value(request, "adapter");
const char *device, *tmp;
- adapter = adapter ? adapter : BLUEZ_DEFAULT_ADAPTER;
+ call_work_lock(ns);
+ adapter = adapter ? adapter : ns->default_adapter;
+ call_work_unlock(ns);
device = afb_req_value(request, "device");
if (!device)