2009-04-15 Marcus Brinkmann <marcus@g10code.de>

* posix-io.c (_gpgme_io_socket, _gpgme_io_connect): New functions.
	* w32-io.c (_gpgme_io_connect): Fix stupid error.
This commit is contained in:
Marcus Brinkmann 2009-04-15 12:04:21 +00:00
parent d255b4bec9
commit 2dce8370e7
3 changed files with 34 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2009-04-15 Marcus Brinkmann <marcus@g10code.de>
* 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 <marcus@g10code.de> 2009-04-08 Marcus Brinkmann <marcus@g10code.de>
* w32-glib-io.c (giochannel_table): New members used, fd, socket. * w32-glib-io.c (giochannel_table): New members used, fd, socket.

View File

@ -653,3 +653,31 @@ _gpgme_io_dup (int fd)
return new_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);
}

View File

@ -1514,13 +1514,12 @@ _gpgme_io_socket (int domain, int type, int proto)
int int
_gpgme_io_connect (int fd, struct sockaddr *addr, int addrlen) _gpgme_io_connect (int fd, struct sockaddr *addr, int addrlen)
{ {
int sockfd;
int res; int res;
TRACE_BEG2 (DEBUG_SYSIO, "_gpgme_io_connect", fd, TRACE_BEG2 (DEBUG_SYSIO, "_gpgme_io_connect", fd,
"addr=%p, addrlen=%i", addr, addrlen); "addr=%p, addrlen=%i", addr, addrlen);
res = connect (sockfd, addr, addrlen); res = connect (fd, addr, addrlen);
if (!res) if (!res)
{ {
errno = wsa2errno (WSAGetLastError ()); errno = wsa2errno (WSAGetLastError ());