input/ipc-unix: don't delete file for abstract sockets

If --input-ipc-server path name starts with "@", then "@" is replaced
with a null character, which represents the abstract socket namespace
on Linux. Because abstract sockets have no file system presence, it
should not delete the file with the same name starting with "@".
This commit is contained in:
nanahi
2026-03-26 21:22:18 -04:00
committed by Kacper Michajłow
parent c2d9905598
commit b11ae04f37
+2 -2
View File
@@ -323,11 +323,11 @@ static MP_THREAD_VOID ipc_thread(void *p)
ipc_un.sun_family = AF_UNIX,
strncpy(ipc_un.sun_path, arg->path, sizeof(ipc_un.sun_path) - 1);
unlink(ipc_un.sun_path);
if (ipc_un.sun_path[0] == '@') {
ipc_un.sun_path[0] = '\0';
path_len--;
} else {
unlink(ipc_un.sun_path);
}
size_t addr_len = offsetof(struct sockaddr_un, sun_path) + 1 + path_len;