mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2026-08-06 21:12:12 +00:00
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@redhat.com> Acked-by: Kevin Pouget <kpouget@redhat.com>
This commit is contained in:
parent
a6ccd2a309
commit
1bf9d22cf2
@ -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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user