[PATCH] Print an error message if g_dbus_setup_bus fails.

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

 



That is standard processing when dbus_error_is_set() returns true, according to
dbus/dbus/dbus-errors.c.
In this case of g_dbus_setup_bus(), it provides extra help for determing the
specific cause of the error.
---
 src/main.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/main.c b/src/main.c
index 7fecc5a..6dc60a4 100644
--- a/src/main.c
+++ b/src/main.c
@@ -311,6 +311,7 @@ static int connect_dbus(void)
 	conn = g_dbus_setup_bus(DBUS_BUS_SYSTEM, BLUEZ_NAME, &err);
 	if (!conn) {
 		if (dbus_error_is_set(&err)) {
+			g_printerr("an error occurred: %s\n", err.message);
 			dbus_error_free(&err);
 			return -EIO;
 		}
-- 
1.7.6

--
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