summaryrefslogtreecommitdiffstats
path: root/common/iobuf.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2007-06-25 13:54:43 +0200
committerWerner Koch <wk@gnupg.org>2007-06-25 13:54:43 +0200
commit831cd76256290541a102bc660442918c95a65e6c (patch)
treec5b54be81f3530fee16f7d6ecf832a235bdba222 /common/iobuf.c
parentImplemented the --gen-key command as we can't use the gpgsm-gencert.sh under ... (diff)
downloadgnupg2-831cd76256290541a102bc660442918c95a65e6c.tar.xz
gnupg2-831cd76256290541a102bc660442918c95a65e6c.zip
Fixed a problem in estream-printf.c.
Changes for Windows (gpgsm -k does now work). Minor cleanups.
Diffstat (limited to 'common/iobuf.c')
-rw-r--r--common/iobuf.c28
1 files changed, 2 insertions, 26 deletions
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;