Skip to contentSkip to conversation

Print an error message if g_dbus_setup_bus fails.

PATCH In review Burt Silverman 2 participants 3 messages Aug 26, 2011 – Sep 8, 2011 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Print an error message if g_dbus_setup_bus fails.

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(-)
src/main.c +1 -0
index 7fecc5a..6dc60a4 100644
@@ -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;
 		}
Signature · 1 line
1.7.6
#1 lore raw

Hi Burt,

Quoted 7 lines · Burt Silverman

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

Applied (after I made the message prefix a bit more descriptive). Thanks.

Johan

#2 lore raw

Thanks, Johan. I use Fedora Linux, and their "preupgrade" mechanism often gets me into trouble, in various places, including bluetooth! --Burt