From: Mike Gorse Date: Fri, 6 May 2011 15:59:45 +0000 (-0500) Subject: Call g_error if unable to find the accessibility bus X-Git-Tag: AT_SPI2_CORE_2_1_1~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=112afd0b8d8404b7b74549eae867f5f4f8276289;hp=b12cdda617ae1b3c45d7a553a96571736b7753bb;p=platform%2Fupstream%2Fat-spi2-core.git Call g_error if unable to find the accessibility bus Previously, AT-SPI would wind up passing a NULL connection to libdbus if it couldn't connect to the bus, causing a cryptic abort. This change makes it at least abort with a sensible error message in that case. Also, if unable to find the accessibility bus address via the session bus, save and print the DBusError, if any. --- diff --git a/atspi/atspi-misc.c b/atspi/atspi-misc.c index 1f51fa9..720970a 100644 --- a/atspi/atspi-misc.c +++ b/atspi/atspi-misc.c @@ -112,6 +112,8 @@ _atspi_bus () { if (!bus) atspi_init (); + if (!bus) + g_error ("AT-SPI: COuldn't connect to accessibility bus. Is at-spi-bus-launcher running?"); return bus; } @@ -1290,6 +1292,7 @@ get_accessibility_bus_address_dbus (void) DBusConnection *session_bus = NULL; DBusMessage *message; DBusMessage *reply; + DBusError error; char *address = NULL; session_bus = dbus_bus_get (DBUS_BUS_SESSION, NULL); @@ -1301,14 +1304,20 @@ get_accessibility_bus_address_dbus (void) "org.a11y.Bus", "GetAddress"); + dbus_error_init (&error); reply = dbus_connection_send_with_reply_and_block (session_bus, message, -1, - NULL); + &error); dbus_message_unref (message); if (!reply) + { + g_warning ("Error retrieving accessibility bus address: %s: %s", + error.name, error.message); + dbus_error_init (&error); return NULL; + } { const char *tmp_address;