From a9014f6d835752306f1ef313bb2c38e72ff4e99c 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. --- trunk/src/ChangeLog | 5 +++++ trunk/src/posix-io.c | 28 ++++++++++++++++++++++++++++ trunk/src/w32-io.c | 3 +-- 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/trunk/src/ChangeLog b/trunk/src/ChangeLog index 3a570f5..1dcdb21 100644 --- a/trunk/src/ChangeLog +++ b/trunk/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/trunk/src/posix-io.c b/trunk/src/posix-io.c index a7047bd..c85255e 100644 --- a/trunk/src/posix-io.c +++ b/trunk/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/trunk/src/w32-io.c b/trunk/src/w32-io.c index 1a65e53..69d8a39 100644 --- a/trunk/src/w32-io.c +++ b/trunk/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