From 264a98a22a314bd193933c2ebd2aefd256b11138 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 5 Jan 2013 12:08:04 -0800 Subject: [PATCH] core: Ignore updates if controller name and short name are identical --- src/adapter.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/adapter.c b/src/adapter.c index 8831e2303..56a715ce1 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -696,6 +696,10 @@ static void local_name_changed_callback(uint16_t index, uint16_t length, DBG("Name: %s", rp->name); DBG("Short name: %s", rp->short_name); + if (!g_strcmp0(adapter->short_name, (const char *) rp->short_name) && + !g_strcmp0(adapter->name, (const char *) rp->name)) + return; + g_free(adapter->name); adapter->name = g_strdup((const char *) rp->name); @@ -745,10 +749,8 @@ static void set_local_name_complete(uint8_t status, uint16_t length, } /* - * Call function to indicate local name changed. - * - * The parameters are idential and that also the task that - * is required in both cases. So it is safe to just call the + * The parameters are idential and also the task that is + * required in both cases. So it is safe to just call the * event handling functions here. */ local_name_changed_callback(adapter->dev_id, length, param, adapter); -- 2.47.3