summaryrefslogtreecommitdiff
path: root/src/assuan-pipe-server.c
diff options
context:
space:
mode:
authorMarcus Brinkmann <mb@g10code.com>2009-11-25 17:55:26 +0000
committerMarcus Brinkmann <mb@g10code.com>2009-11-25 17:55:26 +0000
commitb41cc03c891deac4bb35af3c88f8b635ebfb632c (patch)
treeccf200bd7e05c36da7a9ccf04a9b0e8bd9464be8 /src/assuan-pipe-server.c
parentabcfd15596e44ada3ff58a6510639f9760b98b61 (diff)
downloadlibassuan-b41cc03c891deac4bb35af3c88f8b635ebfb632c.tar.gz
doc/
2009-11-25 Marcus Brinkmann <marcus@g10code.de> * assuan.texi (Data Types): Document assuan_fdopen. src/ 2009-11-25 Marcus Brinkmann <marcus@g10code.de> * assuan.h (assuan_init_pipe_server): Change type of filedes to assuan_fd_t. (assuan_fdopen): New prototype. * libassuan.vers, libassuan.def: Add assuan_fdopen. * system.c (assuan_fdopen): New function. * assuan-pipe-server.c (assuan_init_pipe_server): Change type of filedes to assuan_fd_t. No longer translate fd to handle. Don't set to binary either (that doesn't do anything for handles, it only affects the libc fd).
Diffstat (limited to 'src/assuan-pipe-server.c')
-rw-r--r--src/assuan-pipe-server.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/assuan-pipe-server.c b/src/assuan-pipe-server.c
index f195697..cb15de4 100644
--- a/src/assuan-pipe-server.c
+++ b/src/assuan-pipe-server.c
@@ -51,7 +51,7 @@ is_valid_socket (const char *s)
/* This actually is a int file descriptor (and not assuan_fd_t) as
_get_osfhandle is called on W32 systems. */
gpg_error_t
-assuan_init_pipe_server (assuan_context_t ctx, int filedes[2])
+assuan_init_pipe_server (assuan_context_t ctx, assuan_fd_t filedes[2])
{
const char *s;
unsigned long ul;
@@ -65,13 +65,8 @@ assuan_init_pipe_server (assuan_context_t ctx, int filedes[2])
return rc;
#ifdef HAVE_W32_SYSTEM
- /* MS Windows has so many different types of handle that one needs
- to tranlsate them at many place forth and back. Also make sure
- that the file descriptors are in binary mode. */
- setmode (filedes[0], O_BINARY);
- setmode (filedes[1], O_BINARY);
- infd = (void*)_get_osfhandle (filedes[0]);
- outfd = (void*)_get_osfhandle (filedes[1]);
+ infd = filedes[0];
+ outfd = filedes[1];
#else
s = getenv ("_assuan_connection_fd");
if (s && *s && is_valid_socket (s))