summaryrefslogtreecommitdiffstats
path: root/hcid/dbus-adapter.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2006-07-26 11:30:25 +0000
committerJohan Hedberg <johan.hedberg@nokia.com>2006-07-26 11:30:25 +0000
commit8932ff2db1c87cf1a84390fb313588c7d926edc0 (patch)
tree301ae5a4eea306e97be00bb85fc16608eb65bfad /hcid/dbus-adapter.c
parent2338a866224cbb390afbee7140299ae7fcb1deb8 (diff)
GetName: always try to read the stored name first
Diffstat (limited to 'hcid/dbus-adapter.c')
-rw-r--r--hcid/dbus-adapter.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/hcid/dbus-adapter.c b/hcid/dbus-adapter.c
index b77424f0..ac0b7bc4 100644
--- a/hcid/dbus-adapter.c
+++ b/hcid/dbus-adapter.c
@@ -878,21 +878,15 @@ static DBusHandlerResult handle_dev_get_name_req(DBusConnection *conn, DBusMessa
struct hci_dbus_data *dbus_data = data;
DBusMessage *reply;
char str[249], *str_ptr = str;
- int err = -1;
- struct hci_dev_info di;
+ int err;
+ bdaddr_t ba;
if (!dbus_message_has_signature(msg, DBUS_TYPE_INVALID_AS_STRING))
return error_invalid_arguments(conn, msg);
- /* If the device is DOWN, try to read the name from storage file */
- if (hci_devinfo(dbus_data->dev_id, &di) == 0 && !hci_test_bit(HCI_UP, &di.flags)) {
- bdaddr_t ba;
-
- str2ba(dbus_data->address, &ba);
-
- err = read_local_name(&ba, str);
- }
+ str2ba(dbus_data->address, &ba);
+ err = read_local_name(&ba, str);
if (err < 0)
err = get_device_name(dbus_data->dev_id, str, sizeof(str));