mirror of
https://github.com/neovim/neovim.git
synced 2025-09-19 09:48:19 +00:00
Implement server_address_new()
When creating a local socket/pipe (server_start()) Neovim used vim_tempname() to generate a unique socket path. For Windows UNIX filepaths cannot be used as pipe names (they must start with \\.\pipe\). This commit replaces the use of vim_tempname() for server addresses with server_address_new(). server_address_new() generates unique names for local sockets/pipes - for UNIX it uses vim_tempname(), for Windows generates names in the form \\.\pipe\nvim-PID-COUNTER where PID is the current process id, and COUNTER is a static uint32_t counter incremented with every call. This function is now used for server_start() and server_init() when no address is available.
This commit is contained in:
@@ -14572,7 +14572,7 @@ static void f_serverstart(typval_T *argvars, typval_T *rettv)
|
||||
rettv->vval.v_string = vim_strsave(get_tv_string(argvars));
|
||||
}
|
||||
} else {
|
||||
rettv->vval.v_string = vim_tempname();
|
||||
rettv->vval.v_string = (char_u *)server_address_new();
|
||||
}
|
||||
|
||||
int result = server_start((char *) rettv->vval.v_string);
|
||||
|
Reference in New Issue
Block a user