From b11ae04f37bee8134b191a180c8e5b3ea1e249d1 Mon Sep 17 00:00:00 2001 From: nanahi <130121847+na-na-hi@users.noreply.github.com> Date: Thu, 26 Mar 2026 21:22:18 -0400 Subject: [PATCH] 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 "@". --- input/ipc-unix.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/input/ipc-unix.c b/input/ipc-unix.c index 3eab683506..3c5bbc3178 100644 --- a/input/ipc-unix.c +++ b/input/ipc-unix.c @@ -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;