mirror of
https://github.com/mawww/kakoune.git
synced 2024-11-24 16:15:38 +03:00
Refuse to overwrite an existing session socket
This commit is contained in:
parent
d2dac558e7
commit
14fb71b16c
@ -823,6 +823,9 @@ bool Server::rename_session(StringView name)
|
||||
String new_socket_file = format("{}/kakoune/{}/{}", tmpdir(),
|
||||
get_user_name(), name);
|
||||
|
||||
if (file_exists(new_socket_file))
|
||||
return false;
|
||||
|
||||
if (rename(old_socket_file.c_str(), new_socket_file.c_str()) != 0)
|
||||
return false;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user