[at-spi2-core/gnome-41: 11/14] bus launcher: unlink socket before binding




commit f7d8bc187da50f02672328f507b50fd16ba07c00
Author: Mike Gorse <mgorse suse com>
Date:   Fri Mar 11 10:23:50 2022 -0600

    bus launcher: unlink socket before binding
    
    Ensure_a11y_bus_broker should ensure that the socket doesn't already exist
    before trying to bind to it. Otherwise, binding will fail.
    
    Helps: #43

 bus/at-spi-bus-launcher.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/bus/at-spi-bus-launcher.c b/bus/at-spi-bus-launcher.c
index b8d9f0d2..40c86fba 100644
--- a/bus/at-spi-bus-launcher.c
+++ b/bus/at-spi-bus-launcher.c
@@ -419,7 +419,10 @@ ensure_a11y_bus_broker (A11yBusLauncher *app, char *config_path)
   GError *error = NULL;
 
   if (app->socket_name)
-    strcpy (addr.sun_path, app->socket_name);
+    {
+      strcpy (addr.sun_path, app->socket_name);
+      unlink (app->socket_name);
+    }
 
   /* This detects whether we are running under systemd. We only try to
    * use dbus-broker if we are running under systemd because D-Bus


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]