summaryrefslogtreecommitdiffstats
path: root/hcid
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2008-06-16 16:56:38 +0000
committerLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2008-06-16 16:56:38 +0000
commit289e29c6c4a073569c7e7aa3c8fc51ed5c46993f (patch)
tree805cb9c598279c9a556d9f9410a119a84ca6d11b /hcid
parent1e4c95e09bf53e50ad033febae0d6383517508b4 (diff)
Fix bt_cancel_discovery to only succeed when there is a discover to cancel.
Diffstat (limited to 'hcid')
-rw-r--r--hcid/device.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/hcid/device.c b/hcid/device.c
index f0e57e91..6b9ccac9 100644
--- a/hcid/device.c
+++ b/hcid/device.c
@@ -1061,7 +1061,10 @@ static DBusMessage *cancel_discover(DBusConnection *conn,
str2ba(adapter->address, &src);
str2ba(device->address, &dst);
- bt_cancel_discovery(&src, &dst);
+ if (bt_cancel_discovery(&src, &dst) < 0)
+ return g_dbus_create_error(msg,
+ ERROR_INTERFACE ".Failed",
+ "No pending discover");
return dbus_message_new_method_return(msg);
}