mirror of
https://github.com/mpv-player/mpv.git
synced 2026-05-07 20:02:49 +00:00
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:
+2
-2
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user