summaryrefslogtreecommitdiffstats
path: root/hcid/security.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2005-10-22 12:56:13 +0000
committerMarcel Holtmann <marcel@holtmann.org>2005-10-22 12:56:13 +0000
commitd2506e5078e02804484d5e416e23a49fb646151b (patch)
treec57cf3822556660b1b4afdc233237a29b87f0235 /hcid/security.c
parent97a6bcbbe32c89438f4f54e47b376c75e2949763 (diff)
Make the remote name resolve non-blocking
Diffstat (limited to 'hcid/security.c')
-rw-r--r--hcid/security.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/hcid/security.c b/hcid/security.c
index eb50ee32..f53d33d1 100644
--- a/hcid/security.c
+++ b/hcid/security.c
@@ -496,20 +496,18 @@ static inline void cmd_status(int dev, bdaddr_t *sba, void *ptr)
static inline void remote_name_information(int dev, bdaddr_t *sba, void *ptr)
{
evt_remote_name_req_complete *evt = ptr;
- char name[249];
bdaddr_t dba;
- if (evt->status)
- return;
-
- memset(name, 0, sizeof(name));
- memcpy(name, evt->name, 248);
-
bacpy(&dba, &evt->bdaddr);
- hcid_dbus_remote_name(sba, &dba, name);
-
- write_device_name(sba, &dba, name);
+ if (!evt->status) {
+ char name[249];
+ memset(name, 0, sizeof(name));
+ memcpy(name, evt->name, 248);
+ write_device_name(sba, &dba, name);
+ hcid_dbus_remote_name(sba, &dba, name);
+ } else
+ hcid_dbus_remote_name_failed(sba, &dba, evt->status);
}
static inline void remote_version_information(int dev, bdaddr_t *sba, void *ptr)