Diff between cd11ef2dd9ae509a7770ae85fcff1a2967a2d1fc and 264a98a22a314bd193933c2ebd2aefd256b11138

Changed Files

File Additions Deletions Status
src/adapter.c +6 -4 modified

Full Patch

diff --git a/src/adapter.c b/src/adapter.c
index 8831e23..56a715c 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);