1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 17:38:00 +00:00

Merge named_pipe_agent_exists() fix from 'pre-0.75'.

This commit is contained in:
Simon Tatham 2021-04-25 06:11:04 +01:00
commit 7f3a3a21eb

View File

@ -147,9 +147,13 @@ Socket *agent_connect(Plug *plug)
static bool named_pipe_agent_exists(void)
{
char *pipename = agent_named_pipe_name();
DWORD type = GetFileType(pipename);
WIN32_FIND_DATA data;
HANDLE ffh = FindFirstFile(pipename, &data);
sfree(pipename);
return type == FILE_TYPE_PIPE;
if (ffh == INVALID_HANDLE_VALUE)
return false;
FindClose(ffh);
return true;
}
bool agent_exists(void)