aboutsummaryrefslogtreecommitdiffstats
path: root/binding/bluetooth-api.c
diff options
context:
space:
mode:
Diffstat (limited to 'binding/bluetooth-api.c')
-rw-r--r--binding/bluetooth-api.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/binding/bluetooth-api.c b/binding/bluetooth-api.c
index 2309ef6..24ff11c 100644
--- a/binding/bluetooth-api.c
+++ b/binding/bluetooth-api.c
@@ -531,6 +531,7 @@ static int bluetooth_get_adapters_count(struct init_data *id)
AFB_INFO("object_properties for adapters count error: %s",
error->message);
g_clear_error(&error);
+ count = -EIO;
} else {
json_object_object_get_ex(jresp, "adapters", &jobj);
count = json_object_array_length(jobj);
@@ -648,9 +649,12 @@ static gpointer bluetooth_func(gpointer ptr)
rc = bluetooth_register_agent(id);
if (rc) {
AFB_ERROR("bluetooth_register_agent() failed");
- goto err_no_agent;
+ goto err_no_service;
}
}
+ else if (rc < 0) {
+ goto err_no_service;
+ }
else {
//fake it
AFB_INFO("No adapter present, completed initialization");
@@ -671,7 +675,7 @@ static gpointer bluetooth_func(gpointer ptr)
return NULL;
-err_no_agent:
+err_no_service:
bluetooth_cleanup(ns);
err_no_ns: