diff options
author | Timo Schulz <[email protected]> | 2004-11-24 07:30:08 +0000 |
---|---|---|
committer | Timo Schulz <[email protected]> | 2004-11-24 07:30:08 +0000 |
commit | c36b96808391edf9211b1c60b00825f31be7a93c (patch) | |
tree | a0b446f425c02eea2d44dad2cbf461ff76f9ad11 /src/assuan-pipe-connect.c | |
parent | * assuan-socket-connect.c (LOG): Fixed macro to print not only the (diff) | |
download | libassuan-c36b96808391edf9211b1c60b00825f31be7a93c.tar.gz libassuan-c36b96808391edf9211b1c60b00825f31be7a93c.zip |
2004-11-23 Timo Schulz <[email protected]>
* 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 <[email protected]>
* 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.
Diffstat (limited to 'src/assuan-pipe-connect.c')
-rw-r--r-- | src/assuan-pipe-connect.c | 25 |
1 files changed, 15 insertions, 10 deletions
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 <config.h> #endif @@ -30,7 +30,11 @@ #include <errno.h> #include <fcntl.h> #include <sys/types.h> +#ifndef _WIN32 #include <sys/wait.h> +#else +#include <windows.h> +#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 |