From 37343db08f4aaa36a0f58d2ecf50e7fbba4cacd7 Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Fri, 7 Jul 2023 15:07:34 +0900 Subject: common,gpg,kbx: Factor out open_stream_nc. * common/sysutils.h (open_stream_nc): New. * common/sysutils.c (open_stream_nc): New. * g10/decrypt.c (decrypt_message_fd): Use open_stream_nc. * g10/server.c (cmd_verify): Likewise. * kbx/kbxserver.c (prepare_outstream): Likewise. -- GnuPG-bug-id: 6580 Signed-off-by: NIIBE Yutaka --- g10/server.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'g10/server.c') diff --git a/g10/server.c b/g10/server.c index 8ddfbba8e..24e525e7f 100644 --- a/g10/server.c +++ b/g10/server.c @@ -388,16 +388,7 @@ cmd_verify (assuan_context_t ctx, char *line) if (out_fd != GNUPG_INVALID_FD) { - es_syshd_t syshd; - -#ifdef HAVE_W32_SYSTEM - syshd.type = ES_SYSHD_HANDLE; - syshd.u.handle = out_fd; -#else - syshd.type = ES_SYSHD_FD; - syshd.u.fd = out_fd; -#endif - out_fp = es_sysopen_nc (&syshd, "w"); + out_fp = open_stream_nc (fd, "w"); if (!out_fp) return set_error (gpg_err_code_from_syserror (), "fdopen() failed"); } -- cgit v1.2.3