mirror of
https://github.com/neovim/neovim.git
synced 2025-10-09 11:26:37 +00:00
sockets: don't deadlock when connecting to own pipe address
This commit is contained in:
@@ -97,6 +97,18 @@ char *server_address_new(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
/// Check if this instance owns a pipe address.
|
||||
/// The argument must already be resolved to an absolute path!
|
||||
bool server_owns_pipe_address(const char *path)
|
||||
{
|
||||
for (int i = 0; i < watchers.ga_len; i++) {
|
||||
if (!strcmp(path, ((SocketWatcher **)watchers.ga_data)[i]->addr)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// Starts listening for API calls.
|
||||
///
|
||||
/// The socket type is determined by parsing `endpoint`: If it's a valid IPv4
|
||||
|
Reference in New Issue
Block a user