From c36b96808391edf9211b1c60b00825f31be7a93c Mon Sep 17 00:00:00 2001 From: Timo Schulz Date: Wed, 24 Nov 2004 07:30:08 +0000 Subject: 2004-11-23 Timo Schulz * assuan-socket.c (_assuan_sock_connect): Get local port from the sun_path[] file. (_assuan_sock_bind): Write local port to the sun_path[] file. * assuan-socket-connect.c (assuan_socket_connect): Use DIRSEP_C for a better portability. (assuan-defs.h): Define DIRSEP_C. 2004-11-22 Timo Schulz * assuan-io.c (_assuan_simple_read, _assuan_simple_write): W32 support. * assuan-socket.c (_assuan_close): New. (_assuan_sock_new): New. (_assuan_sock_bind): New. --- src/assuan-pipe-connect.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'src/assuan-pipe-connect.c') diff --git a/src/assuan-pipe-connect.c b/src/assuan-pipe-connect.c index cf2ce23..321582c 100644 --- a/src/assuan-pipe-connect.c +++ b/src/assuan-pipe-connect.c @@ -17,7 +17,7 @@ * License along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ - +#ifndef _WIN32 #ifdef HAVE_CONFIG_H #include #endif @@ -30,7 +30,11 @@ #include #include #include +#ifndef _WIN32 #include +#else +#include +#endif #include "assuan-defs.h" @@ -66,16 +70,16 @@ writen (int fd, const char *buffer, size_t length) static int -do_finish (ASSUAN_CONTEXT ctx) +do_finish (assuan_context_t ctx) { if (ctx->inbound.fd != -1) { - close (ctx->inbound.fd); + _assuan_close (ctx->inbound.fd); ctx->inbound.fd = -1; } if (ctx->outbound.fd != -1) { - close (ctx->outbound.fd); + _assuan_close (ctx->outbound.fd); ctx->outbound.fd = -1; } if (ctx->pid != -1 && ctx->pid) @@ -87,7 +91,7 @@ do_finish (ASSUAN_CONTEXT ctx) } static void -do_deinit (ASSUAN_CONTEXT ctx) +do_deinit (assuan_context_t ctx) { do_finish (ctx); } @@ -101,14 +105,14 @@ do_deinit (ASSUAN_CONTEXT ctx) child right after the fork; ATFORKVALUE is passed as the first argument and 0 is passed as the second argument. The ATFORK function should only act if the second value is 0. */ -AssuanError -assuan_pipe_connect2 (ASSUAN_CONTEXT *ctx, const char *name, char *const argv[], +assuan_error_t +assuan_pipe_connect2 (assuan_context_t *ctx, const char *name, char *const argv[], int *fd_child_list, void (*atfork) (void *opaque, int reserved), void *atforkvalue) { static int fixed_signals = 0; - AssuanError err; + assuan_error_t err; int rp[2]; int wp[2]; char mypidstr[50]; @@ -289,9 +293,10 @@ assuan_pipe_connect2 (ASSUAN_CONTEXT *ctx, const char *name, char *const argv[], returning it in CTX. The server filename is NAME, the argument vector in ARGV. FD_CHILD_LIST is a -1 terminated list of file descriptors not to close in the child. */ -AssuanError -assuan_pipe_connect (ASSUAN_CONTEXT *ctx, const char *name, char *const argv[], +assuan_error_t +assuan_pipe_connect (assuan_context_t *ctx, const char *name, char *const argv[], int *fd_child_list) { return assuan_pipe_connect2 (ctx, name, argv, fd_child_list, NULL, NULL); } +#endif -- cgit v1.2.3