From 2dce8370e75119af7c54397b0c8b9956d9a516e9 Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Wed, 15 Apr 2009 12:04:21 +0000 Subject: [PATCH] 2009-04-15 Marcus Brinkmann * posix-io.c (_gpgme_io_socket, _gpgme_io_connect): New functions. * w32-io.c (_gpgme_io_connect): Fix stupid error. --- src/ChangeLog | 5 +++++ src/posix-io.c | 28 ++++++++++++++++++++++++++++ src/w32-io.c | 3 +-- 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 3a570f5..1dcdb21 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2009-04-15 Marcus Brinkmann + + * posix-io.c (_gpgme_io_socket, _gpgme_io_connect): New functions. + * w32-io.c (_gpgme_io_connect): Fix stupid error. + 2009-04-08 Marcus Brinkmann * w32-glib-io.c (giochannel_table): New members used, fd, socket. diff --git a/src/posix-io.c b/src/posix-io.c index a7047bd..c85255e 100644 --- a/src/posix-io.c +++ b/src/posix-io.c @@ -653,3 +653,31 @@ _gpgme_io_dup (int fd) return new_fd; } + + +int +_gpgme_io_socket (int domain, int type, int proto) +{ + int res; + + TRACE_BEG2 (DEBUG_SYSIO, "_gpgme_io_socket", domain, + "type=%i, proto=%i", type, proto); + + res = socket (domain, type, proto); + + return TRACE_SYSRES (res); +} + + +int +_gpgme_io_connect (int fd, struct sockaddr *addr, int addrlen) +{ + int res; + + TRACE_BEG2 (DEBUG_SYSIO, "_gpgme_io_connect", fd, + "addr=%p, addrlen=%i", addr, addrlen); + + res = ath_connect (fd, addr, addrlen); + + return TRACE_SYSRES (res); +} diff --git a/src/w32-io.c b/src/w32-io.c index 1a65e53..69d8a39 100644 --- a/src/w32-io.c +++ b/src/w32-io.c @@ -1514,13 +1514,12 @@ _gpgme_io_socket (int domain, int type, int proto) int _gpgme_io_connect (int fd, struct sockaddr *addr, int addrlen) { - int sockfd; int res; TRACE_BEG2 (DEBUG_SYSIO, "_gpgme_io_connect", fd, "addr=%p, addrlen=%i", addr, addrlen); - res = connect (sockfd, addr, addrlen); + res = connect (fd, addr, addrlen); if (!res) { errno = wsa2errno (WSAGetLastError ()); -- 2.26.2