/* -*- mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
- *
- * at-spi-bus-launcher: Manage the a11y bus as a child process
+ *
+ * at-spi-bus-launcher: Manage the a11y bus as a child process
*
* Copyright 2011 Red Hat, Inc.
*
#ifdef __linux
#include <sys/prctl.h>
prctl (PR_SET_PDEATHSIG, 15);
-#endif
+#endif
}
/**
gpointer data)
{
A11yBusLauncher *app = data;
-
+
app->a11y_bus_pid = -1;
app->state = A11Y_BUS_STATE_ERROR;
if (app->a11y_launch_error_message == NULL)
app->a11y_launch_error_message = g_strdup_printf ("Bus stopped by signal %d", WSTOPSIG (status));
}
g_main_loop_quit (app->loop);
-}
+}
static gboolean
ensure_a11y_bus (A11yBusLauncher *app)
if (app->a11y_bus_pid != 0)
return FALSE;
-
+
argv[1] = g_strdup_printf ("--config-file=%s/at-spi2/accessibility.conf", SYSCONFDIR);
if (pipe (app->pipefd) < 0)
g_error ("Failed to create pipe: %s", strerror (errno));
-
+
if (!g_spawn_async (NULL,
argv,
NULL,
}
#endif
+ if (argv[1]) g_free(argv[1]);
+
return TRUE;
-
+
error:
+ if (argv[1]) g_free(argv[1]);
close (app->pipefd[0]);
close (app->pipefd[1]);
app->state = A11Y_BUS_STATE_ERROR;
A11yBusLauncher *app = user_data;
const gchar *type = g_variant_get_type_string (value);
gboolean enabled;
-
+
if (g_strcmp0 (type, "b") != 0)
{
g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS,
A11yBusLauncher *app = user_data;
GError *error;
guint registration_id;
-
+
if (connection == NULL)
{
g_main_loop_quit (app->loop);
gpointer data)
{
A11yBusLauncher *app = data;
-
+
g_main_loop_quit (app->loop);
return FALSE;
bridge_display = XOpenDisplay (NULL);
if (!bridge_display)
return FALSE;
-
+
AT_SPI_BUS = XInternAtom (bridge_display, "AT_SPI_BUS", False);
XGetWindowProperty (bridge_display,
XDefaultRootWindow (bridge_display),
{
LOGD("Terminating screen reader");
int ret;
+ int ret_aul;
if (bl->pid <= 0)
return FALSE;
}
LOGD("terminate process with pid %d", bl->pid);
- if (!aul_terminate_pid(bl->pid))
+ ret_aul = aul_terminate_pid(bl->pid);
+ if (ret_aul >= 0)
{
+ LOGD("Terminating with aul_terminate_pid: return is %d", ret_aul);
bl->pid = 0;
return TRUE;
}
+ else
+ LOGD("aul_terminate_pid failed: return is %d", ret_aul);
LOGD("Unable to terminate process using aul api. Sending SIGTERM signal");
ret = kill(bl->pid, SIGTERM);
if (_global_app->a11y_bus_pid > 0)
kill (_global_app->a11y_bus_pid, SIGTERM);
- /* Clear the X property if our bus is gone; in the case where e.g.
+ /* Clear the X property if our bus is gone; in the case where e.g.
* GDM is launching a login on an X server it was using before,
* we don't want early login processes to pick up the stale address.
*/