[PATCH v2 4/5] hostname: Fix setting adapter name to empty string

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If pretty hostname is not set empty string is received. Don't update
adapters' names is such case.
---
 plugins/hostname.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/plugins/hostname.c b/plugins/hostname.c
index 0b75fac..74c25df 100644
--- a/plugins/hostname.c
+++ b/plugins/hostname.c
@@ -117,6 +117,12 @@ static void property_changed(GDBusProxy *proxy, const char *name,
 
 			DBG("pretty hostname: %s", str);
 
+			if (g_str_equal(str, "") == TRUE) {
+				g_free(pretty_hostname);
+				pretty_hostname = NULL;
+				return;
+			}
+
 			g_free(pretty_hostname);
 			pretty_hostname = g_strdup(str);
 
-- 
1.8.1.2

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux