aboutsummaryrefslogtreecommitdiffstats
path: root/g10/server.c
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2023-07-05 04:22:16 +0000
committerNIIBE Yutaka <[email protected]>2023-07-05 04:22:16 +0000
commitf2dcd158a5fff746507a5bd94ad9f4c7aece0901 (patch)
tree5b5bebca877f51f0556d3d400ac902bbbe80e0cf /g10/server.c
parentgpg: Format the value of type gnupg_fd_t by casting to int. (diff)
downloadgnupg-f2dcd158a5fff746507a5bd94ad9f4c7aece0901.tar.gz
gnupg-f2dcd158a5fff746507a5bd94ad9f4c7aece0901.zip
gpg: Fix gpg --server mode on Windows.
* g10/server.c (cmd_encrypt): Don't translate_sys2libc_fd, since it requires HANDLE on Windows. (cmd_decrypt): Likewise. -- GnuPG-bug-id: 6580 Signed-off-by: NIIBE Yutaka <[email protected]>
Diffstat (limited to 'g10/server.c')
-rw-r--r--g10/server.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/g10/server.c b/g10/server.c
index 60b447c41..8ddfbba8e 100644
--- a/g10/server.c
+++ b/g10/server.c
@@ -265,7 +265,7 @@ cmd_encrypt (assuan_context_t ctx, char *line)
{
ctrl_t ctrl = assuan_get_pointer (ctx);
gpg_error_t err;
- int inp_fd, out_fd;
+ gnupg_fd_t inp_fd, out_fd;
(void)line; /* LINE is not used. */
@@ -276,14 +276,14 @@ cmd_encrypt (assuan_context_t ctx, char *line)
goto leave;
}
- inp_fd = translate_sys2libc_fd (assuan_get_input_fd (ctx), 0);
- if (inp_fd == -1)
+ inp_fd = assuan_get_input_fd (ctx);
+ if (inp_fd == GNUPG_INVALID_FD)
{
err = set_error (GPG_ERR_ASS_NO_INPUT, NULL);
goto leave;
}
- out_fd = translate_sys2libc_fd (assuan_get_output_fd (ctx), 1);
- if (out_fd == -1)
+ out_fd = assuan_get_output_fd (ctx);
+ if (out_fd == GNUPG_INVALID_FD)
{
err = set_error (GPG_ERR_ASS_NO_OUTPUT, NULL);
goto leave;
@@ -327,15 +327,15 @@ cmd_decrypt (assuan_context_t ctx, char *line)
{
ctrl_t ctrl = assuan_get_pointer (ctx);
gpg_error_t err;
- int inp_fd, out_fd;
+ gnupg_fd_t inp_fd, out_fd;
(void)line; /* LINE is not used. */
- inp_fd = translate_sys2libc_fd (assuan_get_input_fd (ctx), 0);
- if (inp_fd == -1)
+ inp_fd = assuan_get_input_fd (ctx);
+ if (inp_fd == GNUPG_INVALID_FD)
return set_error (GPG_ERR_ASS_NO_INPUT, NULL);
- out_fd = translate_sys2libc_fd (assuan_get_output_fd (ctx), 1);
- if (out_fd == -1)
+ out_fd = assuan_get_output_fd (ctx);
+ if (out_fd == GNUPG_INVALID_FD)
return set_error (GPG_ERR_ASS_NO_OUTPUT, NULL);
glo_ctrl.lasterr = 0;