aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2023-07-13 04:44:32 +0000
committerNIIBE Yutaka <[email protected]>2023-07-13 04:46:43 +0000
commit69c1d812842c2cd50e7139c3aa851930dad08b72 (patch)
tree665dbfaefa29d99df2637270af9bfa88c6687c46
parentsm: Use open_stream_nc for HANDLE by assuan_get_output_fd. (diff)
downloadgnupg-69c1d812842c2cd50e7139c3aa851930dad08b72.tar.gz
gnupg-69c1d812842c2cd50e7139c3aa851930dad08b72.zip
sm: Use gnupg_fd_t and open_stream_nc for assuan_get_input_fd.
* sm/server.c (cmd_genkey): Use open_stream_nc for input and output. (cmd_getauditlog): Use open_stream_nc for output. -- GnuPG-bug-id: 6580 Signed-off-by: NIIBE Yutaka <[email protected]>
-rw-r--r--sm/server.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/sm/server.c b/sm/server.c
index 934d3764d..bb048a62a 100644
--- a/sm/server.c
+++ b/sm/server.c
@@ -1090,24 +1090,24 @@ static gpg_error_t
cmd_genkey (assuan_context_t ctx, char *line)
{
ctrl_t ctrl = assuan_get_pointer (ctx);
- int inp_fd, out_fd;
+ gnupg_fd_t inp_fd, out_fd;
estream_t in_stream, out_stream;
int rc;
(void)line;
- 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);
- in_stream = es_fdopen_nc (inp_fd, "r");
+ in_stream = open_stream_nc (inp_fd, "r");
if (!in_stream)
return set_error (GPG_ERR_ASS_GENERAL, "es_fdopen failed");
- out_stream = es_fdopen_nc (out_fd, "w");
+ out_stream = open_stream_nc (out_fd, "w");
if (!out_stream)
{
es_fclose (in_stream);
@@ -1138,7 +1138,7 @@ static gpg_error_t
cmd_getauditlog (assuan_context_t ctx, char *line)
{
ctrl_t ctrl = assuan_get_pointer (ctx);
- int out_fd;
+ gnupg_fd_t out_fd;
estream_t out_stream;
int opt_data, opt_html;
int rc;
@@ -1159,11 +1159,11 @@ cmd_getauditlog (assuan_context_t ctx, char *line)
}
else
{
- 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);
- out_stream = es_fdopen_nc (out_fd, "w");
+ out_stream = open_stream_nc (out_fd, "w");
if (!out_stream)
{
return set_error (GPG_ERR_ASS_GENERAL, "es_fdopen() failed");