From 831cd76256290541a102bc660442918c95a65e6c Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Mon, 25 Jun 2007 11:54:43 +0000 Subject: Fixed a problem in estream-printf.c. Changes for Windows (gpgsm -k does now work). Minor cleanups. --- common/iobuf.c | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) (limited to 'common/iobuf.c') diff --git a/common/iobuf.c b/common/iobuf.c index 40af196da..f395405f6 100644 --- a/common/iobuf.c +++ b/common/iobuf.c @@ -40,6 +40,7 @@ #endif /* __riscos__ */ #include "util.h" +#include "sysutils.h" #include "iobuf.h" /* The size of the internal buffers. @@ -2350,37 +2351,12 @@ iobuf_read_line (iobuf_t a, byte ** addr_of_buffer, return nbytes; } -/* This is the non iobuf specific function */ -int -iobuf_translate_file_handle (int fd, int for_write) -{ -#ifdef _WIN32 - { - int x; - - if (fd <= 2) - return fd; /* do not do this for error, stdin, stdout, stderr */ - - x = _open_osfhandle (fd, for_write ? 1 : 0); - if (x == -1) - log_error ("failed to translate osfhandle %p\n", (void *) fd); - else - { - /*log_info ("_open_osfhandle %p yields %d%s\n", - (void*)fd, x, for_write? " for writing":"" ); */ - fd = x; - } - } -#endif - return fd; -} - static int translate_file_handle (int fd, int for_write) { #ifdef _WIN32 #ifdef FILE_FILTER_USES_STDIO - fd = iobuf_translate_file_handle (fd, for_write); + fd = translate_sys2libc_fd (fd, for_write); #else { int x; -- cgit v1.2.3