summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Jagiello <m.jagiello@samsung.com>2014-04-14 12:26:08 +0200
committerMike Gorse <mgorse@suse.com>2014-04-22 09:16:15 -0500
commitb62063e1fe017b7db94bdec212d0896de536abe3 (patch)
tree19c031ee3a407d35c3cee65f7983d6b431763c8d
parent02b5e6e5f1da2ec764d17bbeb9c0f23a758acee3 (diff)
downloadat-spi2-core-b62063e1fe017b7db94bdec212d0896de536abe3.tar.gz
Add GError setter in atspi_accessible_get_process_id function
-rw-r--r--atspi/atspi-accessible.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/atspi/atspi-accessible.c b/atspi/atspi-accessible.c
index 4ce89e37..ccf1484b 100644
--- a/atspi/atspi-accessible.c
+++ b/atspi/atspi-accessible.c
@@ -1651,12 +1651,13 @@ atspi_accessible_clear_cache (AtspiAccessible *accessible)
/**
* atspi_accessible_get_process_id:
* @accessible: The #AtspiAccessible to query.
+ * @error: a pointer to a %NULL #GError pointer
*
* Returns the process id associated with the given accessible. Mainly
* added for debugging; it is a shortcut to explicitly querying the
* accessible's app->bus_name and then calling GetConnectionUnixProcessID.
*
- * Returns: The process ID, or -1 if defunct.
+ * Returns: The process ID or undetermined value if @error is set.
**/
guint
atspi_accessible_get_process_id (AtspiAccessible *accessible, GError **error)
@@ -1667,7 +1668,10 @@ atspi_accessible_get_process_id (AtspiAccessible *accessible, GError **error)
DBusError d_error;
if (!accessible->parent.app || !accessible->parent.app->bus_name)
- return -1;
+ {
+ g_set_error_literal(error, ATSPI_ERROR, ATSPI_ERROR_IPC, "Process is defunct");
+ return -1;
+ }
message = dbus_message_new_method_call ("org.freedesktop.DBus",
"/org/freedesktop/DBus",
@@ -1687,7 +1691,7 @@ atspi_accessible_get_process_id (AtspiAccessible *accessible, GError **error)
}
if (dbus_error_is_set (&d_error))
{
- g_warning ("GetConnectionUnixProcessID failed: %s", d_error.message);
+ g_set_error_literal(error, ATSPI_ERROR, ATSPI_ERROR_IPC, "Process is defunct");
dbus_error_free (&d_error);
}
return pid;