summaryrefslogtreecommitdiffstats
path: root/hcid/dbus.c
diff options
context:
space:
mode:
Diffstat (limited to 'hcid/dbus.c')
-rw-r--r--hcid/dbus.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/hcid/dbus.c b/hcid/dbus.c
index bb8d2528..b1e7a30f 100644
--- a/hcid/dbus.c
+++ b/hcid/dbus.c
@@ -281,7 +281,7 @@ static gboolean register_dbus_path(const char *path, uint16_t path_id, uint16_t
data->discoverable_timeout = DFT_DISCOVERABLE_TIMEOUT;
data->timeout_hits = 0;
data->timeout_handler = NULL;
- data->busy = 0;
+ data->requestor_name = NULL;
if (fallback) {
if (!dbus_connection_register_fallback(connection, path, pvtable, data)) {
@@ -306,12 +306,15 @@ failed:
static gboolean unregister_dbus_path(const char *path)
{
- void *data;
+ struct hci_dbus_data *data;
syslog(LOG_INFO, "Unregister path:%s", path);
- if (dbus_connection_get_object_path_data(connection, path, &data) && data)
+ if (dbus_connection_get_object_path_data(connection, path, (void*)&data) && data) {
+ if (data->requestor_name)
+ free(data->requestor_name);
free(data);
+ }
if (!dbus_connection_unregister_object_path (connection, path)) {
syslog(LOG_ERR, "D-Bus failed to unregister %s object", path);
@@ -555,7 +558,6 @@ void hcid_dbus_inquiry_start(bdaddr_t *local)
{
DBusMessage *message = NULL;
char path[MAX_PATH_LENGTH];
- struct hci_dbus_data *pdata = NULL;
char *local_addr;
bdaddr_t tmp;
int id;
@@ -570,10 +572,6 @@ void hcid_dbus_inquiry_start(bdaddr_t *local)
snprintf(path, sizeof(path), "%s/hci%d", ADAPTER_PATH, id);
- if (dbus_connection_get_object_path_data(connection, path, (void*) &pdata)) {
- pdata->busy = 1;
- }
-
message = dbus_message_new_signal(path, ADAPTER_INTERFACE,
DEV_SIG_DISCOVER_START);
if (message == NULL) {
@@ -596,8 +594,8 @@ failed:
void hcid_dbus_inquiry_complete(bdaddr_t *local)
{
DBusMessage *message = NULL;
- char path[MAX_PATH_LENGTH];
struct hci_dbus_data *pdata = NULL;
+ char path[MAX_PATH_LENGTH];
char *local_addr;
bdaddr_t tmp;
int id;
@@ -613,7 +611,10 @@ void hcid_dbus_inquiry_complete(bdaddr_t *local)
snprintf(path, sizeof(path), "%s/hci%d", ADAPTER_PATH, id);
if (dbus_connection_get_object_path_data(connection, path, (void*) &pdata)) {
- pdata->busy = 0;
+ if (pdata->requestor_name) {
+ free(pdata->requestor_name);
+ pdata->requestor_name = NULL;
+ }
}
message = dbus_message_new_signal(path, ADAPTER_INTERFACE,