aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2022-07-28 01:48:17 +0000
committerNIIBE Yutaka <[email protected]>2022-07-28 04:22:12 +0000
commiteb8725b19570122bef0fdd89d7cd9219f21a3abb (patch)
tree73c766952cd02af7a89679767f2257ba69ce0022
parentImplement the procedure to handle requests from client. (diff)
downloadgnupg-eb8725b19570122bef0fdd89d7cd9219f21a3abb.tar.gz
gnupg-eb8725b19570122bef0fdd89d7cd9219f21a3abb.zip
Fix for return value of ConnectNamedPipe.
Signed-off-by: NIIBE Yutaka <[email protected]>
-rw-r--r--agent/gpg-agent.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/agent/gpg-agent.c b/agent/gpg-agent.c
index 36d919d14..a462d3e52 100644
--- a/agent/gpg-agent.c
+++ b/agent/gpg-agent.c
@@ -2808,15 +2808,15 @@ win32_openssh_thread (void *arg)
if (pipe == INVALID_HANDLE_VALUE)
{
npth_protect ();
- log_error ("cannot create pipe: %ld\n", GetLastError());
+ log_error ("cannot create pipe: %ld\n", GetLastError ());
break;
}
- if (ConnectNamedPipe (pipe, NULL) != FALSE)
+ if (ConnectNamedPipe (pipe, NULL) == 0)
{
npth_protect ();
CloseHandle (pipe);
- log_error ("ConnectNamedPipe returned TRUE unexpectedly\n");
+ log_error ("Error at ConnectNamedPipe: %ld\n", GetLastError ());
break;
}
@@ -2844,7 +2844,7 @@ win32_openssh_thread (void *arg)
syshd.type = ES_SYSHD_HANDLE;
syshd.u.handle = pipe;
- ssh_stream = es_sysopen (&syshd, "r+");
+ ssh_stream = es_sysopen (&syshd, "r+b");
if (!ssh_stream)
{
agent_deinit_default_ctrl (ctrl);