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:
1 parent
c2d9905598
commit
b11ae04f37
1 file changed
+2
-2
+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