diff options
author | Luiz Augusto von Dentz <luiz.dentz@openbossa.org> | 2008-06-16 16:56:38 +0000 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.dentz@openbossa.org> | 2008-06-16 16:56:38 +0000 |
commit | 289e29c6c4a073569c7e7aa3c8fc51ed5c46993f (patch) | |
tree | 805cb9c598279c9a556d9f9410a119a84ca6d11b /hcid | |
parent | 1e4c95e09bf53e50ad033febae0d6383517508b4 (diff) |
Fix bt_cancel_discovery to only succeed when there is a discover to cancel.
Diffstat (limited to 'hcid')
-rw-r--r-- | hcid/device.c | 5 |
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); } |