diff options
author | Mike Gorse <mgorse@suse.com> | 2022-02-16 17:11:08 -0600 |
---|---|---|
committer | Mike Gorse <mgorse@suse.com> | 2022-02-16 17:11:08 -0600 |
commit | 8a6c449701ad0d637a7cc05a1c4b1ba4ee9cb765 (patch) | |
tree | bdd9c9c906d9935b06a069bcef11349922d32405 /bus | |
parent | 182318e21ca0079f0ba485118fadde015d928bf3 (diff) | |
download | at-spi2-core-8a6c449701ad0d637a7cc05a1c4b1ba4ee9cb765.tar.gz |
Bus launcher: ensure that at-spi directory can be created before using
Related to https://gitlab.gnome.org/GNOME/at-spi2-core/issues/43
Diffstat (limited to 'bus')
-rw-r--r-- | bus/at-spi-bus-launcher.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/bus/at-spi-bus-launcher.c b/bus/at-spi-bus-launcher.c index c33ef64c..e552c3fb 100644 --- a/bus/at-spi-bus-launcher.c +++ b/bus/at-spi-bus-launcher.c @@ -548,17 +548,21 @@ ensure_a11y_bus (A11yBusLauncher *app) g_free (at_spi_dir); at_spi_dir = new_dir; } - mkdir (at_spi_dir, 0700); - app->socket_name = g_strconcat (at_spi_dir, "/bus", display, NULL); - g_free (at_spi_dir); - p = strchr (app->socket_name, ':'); - if (p) - *p = '_'; - if (strlen (app->socket_name) >= 100) + if (mkdir (at_spi_dir, 0700) == 0 || errno == EEXIST) { - g_free (app->socket_name); - app->socket_name = NULL; + app->socket_name = g_strconcat (at_spi_dir, "/bus", display, NULL); + g_free (at_spi_dir); + p = strchr (app->socket_name, ':'); + if (p) + *p = '_'; + if (strlen (app->socket_name) >= 100) + { + g_free (app->socket_name); + app->socket_name = NULL; + } } + else + g_free (at_spi_dir); } #ifdef WANT_DBUS_BROKER |