[Spice-commits] server/reds.c

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Mar 3 16:18:17 UTC 2020


 server/reds.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 1bf9d22cf2504a75efc8e6518b76f8729e3153b0
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Fri Sep 15 18:21:32 2017 +0100

    Support abstract Unix sockets
    
    Allows to specify abstract Unix sockets addresses.
    These Unix sockets are supported on Linux and allows to not
    have file system names.
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Kevin Pouget <kpouget at redhat.com>

diff --git a/server/reds.c b/server/reds.c
index df1fb469..34c107a6 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -2588,8 +2588,12 @@ static int reds_init_socket(const char *addr, int portnr, int family)
 
         local.sun_family = AF_UNIX;
         g_strlcpy(local.sun_path, addr, sizeof(local.sun_path));
-        unlink(local.sun_path);
         len = SUN_LEN(&local);
+        if (local.sun_path[0] == '@') {
+            local.sun_path[0] = 0;
+        } else {
+            unlink(local.sun_path);
+        }
         if (bind(slisten, (struct sockaddr *)&local, len) == -1) {
             perror("bind");
             socket_close(slisten);


More information about the Spice-commits mailing list