From 95e5960735be4066d43f77d91ebe78771cd76a43 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Wed, 18 Jun 2008 22:28:07 +0000 Subject: Make RemoveDevice to return when the device is busy discovering services. --- hcid/device.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'hcid/device.c') diff --git a/hcid/device.c b/hcid/device.c index 6736bb54..c0e64564 100644 --- a/hcid/device.c +++ b/hcid/device.c @@ -1071,14 +1071,6 @@ static DBusMessage *discover_services(DBusConnection *conn, goto fail; } - device->discov_active = 1; - device->discov_requestor = g_strdup(dbus_message_get_sender(msg)); - /* track the request owner to cancel it automatically if the owner - * exits */ - device->discov_listener = g_dbus_add_disconnect_watch(conn, - dbus_message_get_sender(msg), - discover_services_req_exit, - device, NULL); return NULL; fail: @@ -1489,6 +1481,15 @@ int device_browse(struct device *device, DBusConnection *conn, req->browse = TRUE; } + device->discov_active = 1; + device->discov_requestor = g_strdup(dbus_message_get_sender(msg)); + /* track the request owner to cancel it automatically if the owner + * exits */ + device->discov_listener = g_dbus_add_disconnect_watch(conn, + dbus_message_get_sender(msg), + discover_services_req_exit, + device, NULL); + return bt_search_service(&src, &dst, &uuid, browse_cb, req, NULL); } -- cgit