diff options
author | Werner Koch <wk@gnupg.org> | 2005-08-09 12:49:11 +0000 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2005-08-09 12:49:11 +0000 |
commit | e0c9ab2751206b517d2b3276a1eef8e707f25a78 (patch) | |
tree | d22d2da5cf9176f4839fbc67b69f5820bc910e4c /src/assuan-io.c | |
parent | 0eaa341223cb60bd3ca9ba91c550ee65e0169e4a (diff) | |
download | libassuan-e0c9ab2751206b517d2b3276a1eef8e707f25a78.tar.gz |
* mkerrors: Include config.h into assuan-errors.c. This is
required so that assuan.h knows about the W32 macro.
* assuan.h [_ASSUAN_EXT_SYM_PREFIX]: New.
* assuan-io.c [_ASSUAN_NO_PTH]: New.
* assuan-pipe-connect.c (fix_signals) [_ASSUAN_NO_FIXED_SIGNALS]: New.
(assuan_pipe_connect2) [_ASSUAN_USE_DOUBLE_FORK]: Use double fork.
(fix_signals) [_ASSUAN_USE_DOUBLE_FORK]: Do not wait..
Diffstat (limited to 'src/assuan-io.c')
-rw-r--r-- | src/assuan-io.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/src/assuan-io.c b/src/assuan-io.c index 3fe11e6..321f2ba 100644 --- a/src/assuan-io.c +++ b/src/assuan-io.c @@ -29,6 +29,7 @@ #include <windows.h> #endif +#ifndef _ASSUAN_NO_PTH extern ssize_t pth_read (int fd, void *buffer, size_t size); extern ssize_t pth_write (int fd, const void *buffer, size_t size); @@ -36,29 +37,34 @@ extern ssize_t pth_write (int fd, const void *buffer, size_t size); #pragma weak pth_read #pragma weak pth_write #endif +#endif /*!_ASSUAN_NO_PTH*/ ssize_t _assuan_simple_read (assuan_context_t ctx, void *buffer, size_t size) { -#ifndef HAVE_W32_SYSTEM - return (pth_read ? pth_read : read) (ctx->inbound.fd, buffer, size); +#ifdef _ASSUAN_NO_PTH + return read (ctx->inbound.fd, buffer, size); #else +# ifndef HAVE_W32_SYSTEM + return (pth_read ? pth_read : read) (ctx->inbound.fd, buffer, size); +# else return pth_read ? pth_read (ctx->inbound.fd, buffer, size) : recv (ctx->inbound.fd, buffer, size, 0); -#endif +# endif +# endif } ssize_t _assuan_simple_write (assuan_context_t ctx, const void *buffer, size_t size) { -#ifndef HAVE_W32_SYSTEM - return (pth_write ? pth_write : write) (ctx->outbound.fd, buffer, size); +#ifdef _ASSUAN_NO_PTH + return write (ctx->outbound.fd, buffer, size); #else +# ifndef HAVE_W32_SYSTEM + return (pth_write ? pth_write : write) (ctx->outbound.fd, buffer, size); +# else return pth_write ? pth_write (ctx->outbound.fd, buffer, size) : send (ctx->outbound.fd, buffer, size, 0); +# endif #endif } - - - - |