diff options
author | Mike Gorse <mgorse@suse.com> | 2022-02-16 17:11:08 -0600 |
---|---|---|
committer | Mike Gorse <mgorse@suse.com> | 2022-09-09 10:46:46 -0500 |
commit | 9f3ebb630da0c5a7acbf4354a3ce65b8c7fe5b6f (patch) | |
tree | 7eb4687053f7f6f03b56896334bcc33e2113b339 | |
parent | 6200c3df01b71f0d8f010a4572876e1465519902 (diff) | |
download | at-spi2-core-9f3ebb630da0c5a7acbf4354a3ce65b8c7fe5b6f.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
-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 7c6c8035..b8d9f0d2 100644 --- a/bus/at-spi-bus-launcher.c +++ b/bus/at-spi-bus-launcher.c @@ -523,17 +523,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 |