DBusMessage *message;
const char *address;
DBusPendingCall *new_pending;
+ dbus_bool_t result;
if (dbus_message_get_type (reply) == DBUS_MESSAGE_TYPE_METHOD_RETURN)
{
"/org/a11y/atspi/cache",
atspi_interface_cache, "GetItems");
- dbus_connection_send_with_reply (app->bus, message, &new_pending, 2000);
+ result = dbus_connection_send_with_reply (app->bus, message, &new_pending, 2000);
dbus_message_unref (message);
- if (!new_pending)
+ if (!result || !new_pending)
return;
dbus_pending_call_set_notify (new_pending, handle_get_items, app, NULL);
}
char *bus_name_dup;
DBusMessage *message;
DBusPendingCall *pending = NULL;
+ dbus_bool_t result;
if (!app_hash)
{
message = dbus_message_new_method_call (bus_name, atspi_path_root,
atspi_interface_application, "GetApplicationBusAddress");
- dbus_connection_send_with_reply (app->bus, message, &pending, 2000);
+ result = dbus_connection_send_with_reply (app->bus, message, &pending, 2000);
dbus_message_unref (message);
- if (!pending)
+ if (!result || !pending)
{
g_hash_table_remove (app_hash, bus_name_dup);
return NULL;
return app;
}
-static AtspiAccessible *
+AtspiAccessible *
ref_accessible (const char *app_name, const char *path)
{
AtspiApplication *app;
bus = atspi_get_a11y_bus ();
if (!bus)
return 2;
- dbus_bus_register (bus, NULL);
+ if (!dbus_bus_register (bus, NULL))
+ return 2;
atspi_dbus_connection_setup_with_g_main(bus, g_main_context_default());
dbus_connection_add_filter (bus, atspi_dbus_filter, NULL, NULL);
match = g_strdup_printf ("type='signal',interface='%s',member='AddAccessible'", atspi_interface_cache);
DBusMessage *message;
gchar *bus_name_dup;
DBusPendingCall *pending = NULL;
+ dbus_bool_t result;
for (l = hung_processes; l; l = l->next)
if (!strcmp (l->data, bus_name))
return;
"Ping");
if (!message)
return;
- dbus_connection_send_with_reply (bus, message, &pending, -1);
+ result = dbus_connection_send_with_reply (bus, message, &pending, -1);
dbus_message_unref (message);
- if (!pending)
+ if (!result || !pending)
return;
bus_name_dup = g_strdup (bus_name);
hung_processes = g_slist_append (hung_processes, bus_name_dup);
const char *type, ...)
{
va_list args;
-
+ DBusMessage * result;
va_start (args, type);
- return _atspi_dbus_call_partial_va (obj, interface, method, error, type, args);
+ result = _atspi_dbus_call_partial_va (obj, interface, method, error, type, args);
+ va_end (args);
+ return result;
}
process_deferred_messages ();
if (dbus_error_is_set (&err))
{
- /* TODO: Set gerror */
+ g_set_error_literal(error, ATSPI_ERROR, ATSPI_ERROR_IPC, err.message);
dbus_error_free (&err);
+ if (reply)
+ dbus_message_unref(reply);
+ return NULL;
}
-
- if (reply && dbus_message_get_type (reply) == DBUS_MESSAGE_TYPE_ERROR)
+ else if (reply && dbus_message_get_type(reply) == DBUS_MESSAGE_TYPE_ERROR)
{
const char *err_str = NULL;
dbus_message_get_args (reply, NULL, DBUS_TYPE_STRING, &err_str, DBUS_TYPE_INVALID);
dbus_message_unref (reply);
return NULL;
}
-
return reply;
}