From: Anderson Lizardo <anderson.lizardo@openbossa.org>
To: linux-bluetooth@vger.kernel.org
Cc: Anderson Lizardo <anderson.lizardo@openbossa.org>
Subject: [PATCH 2/4] Use stored device name (if any) instead of EIR data
Date: Mon, 27 Dec 2010 09:21:06 -0400 [thread overview]
Message-ID: <1293456068-11615-2-git-send-email-anderson.lizardo@openbossa.org> (raw)
In-Reply-To: <1293456068-11615-1-git-send-email-anderson.lizardo@openbossa.org>
The stored device name comes from either name resolution or from a
"complete" EIR name. If available, use it and ignore any further name
present on EIR data.
---
src/event.c | 16 ++++------------
1 files changed, 4 insertions(+), 12 deletions(-)
diff --git a/src/event.c b/src/event.c
index 6598e37..f445dd1 100644
--- a/src/event.c
+++ b/src/event.c
@@ -549,22 +549,14 @@ void btd_event_device_found(bdaddr_t *local, bdaddr_t *peer, uint32_t class,
} else
legacy = TRUE;
- if (eir_data.name) {
+ if (name == NULL && eir_data.name != NULL) {
if (eir_data.name_complete) {
write_device_name(local, peer, eir_data.name);
name_status = NAME_NOT_REQUIRED;
-
- if (name)
- g_free(name);
-
- name = eir_data.name;
- } else {
- if (name)
- free(eir_data.name);
- else
- name = eir_data.name;
}
- }
+ name = eir_data.name;
+ } else if (eir_data.name != NULL)
+ g_free(eir_data.name);
adapter_update_found_devices(adapter, peer, rssi, class, name, alias,
legacy, eir_data.services, name_status);
--
1.7.0.4
next prev parent reply other threads:[~2010-12-27 13:21 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-27 13:21 [PATCH 1/4] Remove ancient NAME_SENT name resolution status Anderson Lizardo
2010-12-27 13:21 ` Anderson Lizardo [this message]
2010-12-27 14:14 ` [PATCH 2/4] Use stored device name (if any) instead of EIR data Luiz Augusto von Dentz
2010-12-27 14:35 ` Anderson Lizardo
2010-12-27 14:53 ` Johan Hedberg
2010-12-27 15:33 ` Anderson Lizardo
2010-12-27 15:21 ` Anderson Lizardo
2010-12-27 18:20 ` Anderson Lizardo
2010-12-27 13:21 ` [PATCH 3/4] Remove outdated comments Anderson Lizardo
2010-12-27 15:09 ` Johan Hedberg
2010-12-27 13:21 ` [PATCH 4/4] Fix leak of EIR data if RSSI does not change Anderson Lizardo
2010-12-27 15:11 ` Johan Hedberg
2010-12-27 18:23 ` Anderson Lizardo
2010-12-27 18:17 ` [PATCH v2] " Anderson Lizardo
2010-12-27 21:48 ` Johan Hedberg
2010-12-27 22:24 ` Anderson Lizardo
2010-12-28 18:16 ` Anderson Lizardo
2010-12-28 18:10 ` [PATCH v3] " Anderson Lizardo
2010-12-28 18:49 ` Johan Hedberg
2010-12-27 15:08 ` [PATCH 1/4] Remove ancient NAME_SENT name resolution status Johan Hedberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1293456068-11615-2-git-send-email-anderson.lizardo@openbossa.org \
--to=anderson.lizardo@openbossa.org \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox