linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] hostname: Add more debug in soft failure cases
@ 2017-09-20 12:54 Bastien Nocera
  2017-09-20 12:54 ` [PATCH 2/2] hostname: Fix "BlueZ 5.XX" adapter name on startup Bastien Nocera
  0 siblings, 1 reply; 9+ messages in thread
From: Bastien Nocera @ 2017-09-20 12:54 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Bastien Nocera

So it's easier to debug problems with the hostname plugin.
---
 plugins/hostname.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/plugins/hostname.c b/plugins/hostname.c
index 4f9dfe6d8..f876d0afb 100644
--- a/plugins/hostname.c
+++ b/plugins/hostname.c
@@ -82,8 +82,10 @@ static void update_name(struct btd_adapter *adapter, gpointer user_data)
 {
 	const char *hostname = get_hostname();
 
-	if (hostname == NULL)
+	if (hostname == NULL) {
+		DBG ("No hostname available yet");
 		return;
+	}
 
 	if (btd_adapter_is_default(adapter)) {
 		DBG("name: %s", hostname);
@@ -281,13 +283,16 @@ static int hostname_init(void)
 
 	hostname_client = g_dbus_client_new(conn, "org.freedesktop.hostname1",
 						"/org/freedesktop/hostname1");
-	if (!hostname_client)
+	if (!hostname_client) {
+		DBG("Failed to get hostname client");
 		return -EIO;
+	}
 
 	hostname_proxy = g_dbus_proxy_new(hostname_client,
 						"/org/freedesktop/hostname1",
 						"org.freedesktop.hostname1");
 	if (!hostname_proxy) {
+		DBG("Failed to get hostname proxy");
 		g_dbus_client_unref(hostname_client);
 		hostname_client = NULL;
 		return -EIO;
@@ -297,6 +302,7 @@ static int hostname_init(void)
 
 	err = btd_register_adapter_driver(&hostname_driver);
 	if (err < 0) {
+		DBG("Failed to register adapter driver");
 		g_dbus_proxy_unref(hostname_proxy);
 		hostname_proxy = NULL;
 		g_dbus_client_unref(hostname_client);
-- 
2.14.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-11-28  9:45 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-20 12:54 [PATCH 1/2] hostname: Add more debug in soft failure cases Bastien Nocera
2017-09-20 12:54 ` [PATCH 2/2] hostname: Fix "BlueZ 5.XX" adapter name on startup Bastien Nocera
2017-09-20 15:48   ` Marcel Holtmann
2017-09-20 16:35     ` Bastien Nocera
2017-09-20 16:59       ` Marcel Holtmann
2017-09-20 18:57         ` Luiz Augusto von Dentz
2017-09-22 13:13           ` Bastien Nocera
2017-10-05 15:40             ` Bastien Nocera
2017-11-28  9:45             ` Bastien Nocera

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).