aboutsummaryrefslogtreecommitdiffstats
path: root/socket.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1999-12-23 08:02:32 +0000
committerEric S. Raymond <esr@thyrsus.com>1999-12-23 08:02:32 +0000
commita28c83880b11c987608194a75a0eb18130b276d3 (patch)
tree30b04cb733655f866b0b44eb17e1d5db546d638e /socket.c
parentf64fbf59c2e26933084c3067fd31d619ee50e0bc (diff)
downloadfetchmail-a28c83880b11c987608194a75a0eb18130b276d3.tar.gz
fetchmail-a28c83880b11c987608194a75a0eb18130b276d3.tar.bz2
fetchmail-a28c83880b11c987608194a75a0eb18130b276d3.zip
Improvements to IPv6 code.
svn path=/trunk/; revision=2676
Diffstat (limited to 'socket.c')
-rw-r--r--socket.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/socket.c b/socket.c
index 9dfa5587..a03be4bf 100644
--- a/socket.c
+++ b/socket.c
@@ -127,7 +127,6 @@ int SockOpen(const char *host, const char *service, const char *options,
void *request = NULL;
int requestlen;
#endif /* NET_SECURITY */
- int i;
#ifdef HAVE_SOCKETPAIR
if (plugin)
@@ -154,7 +153,20 @@ int SockOpen(const char *host, const char *service, const char *options,
ret:
#else /* NET_SECURITY */
+#ifdef HAVE_INNER_CONNECT
i = inner_connect(ai, NULL, 0, NULL, NULL, "fetchmail", NULL);
+#else
+ i = socket(ai->ai_family, ai->ai_socktype, 0);
+ if (i < 0) {
+ freeaddrinfo(ai);
+ return -1;
+ }
+ if (connect(i, (struct sockaddr *) ai->ai_addr, ai->ai_addrlen) < 0) {
+ freeaddrinfo(ai);
+ close(i);
+ return -1;
+ }
+#endif
#endif /* NET_SECURITY */
freeaddrinfo(ai);