aboutsummaryrefslogtreecommitdiffstats
path: root/socket.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1999-10-26 17:30:10 +0000
committerEric S. Raymond <esr@thyrsus.com>1999-10-26 17:30:10 +0000
commit3a2fc51a448f124984b678e7ed43d91e686905d8 (patch)
tree509fe21f46173f6e7a47d4c29a6790ea580763ea /socket.c
parent88bb994db3ce9133196adcdf2e0bf0e0faa07e00 (diff)
downloadfetchmail-3a2fc51a448f124984b678e7ed43d91e686905d8.tar.gz
fetchmail-3a2fc51a448f124984b678e7ed43d91e686905d8.tar.bz2
fetchmail-3a2fc51a448f124984b678e7ed43d91e686905d8.zip
IP-address hostnames work again.
svn path=/trunk/; revision=2639
Diffstat (limited to 'socket.c')
-rw-r--r--socket.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/socket.c b/socket.c
index 058fe2d5..db0d7000 100644
--- a/socket.c
+++ b/socket.c
@@ -248,6 +248,23 @@ int SockOpen(const char *host, int clientPort, const char *options,
errno = olderr;
return -1;
}
+ } else {
+ ad.sin_port = htons(clientPort);
+
+ sock = socket(AF_INET, SOCK_STREAM, 0);
+ if (sock < 0)
+ {
+ h_errno = 0;
+ return -1;
+ }
+ if (connect(sock, (struct sockaddr *) &ad, sizeof(ad)) < 0)
+ {
+ int olderr = errno;
+ close(sock);
+ h_errno = 0;
+ errno = olderr;
+ return -1;
+ }
}
return(sock);
}