aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2007-02-02 17:16:06 +0000
committerYang Tse <yangsita@gmail.com>2007-02-02 17:16:06 +0000
commitc26ec47e907e3707bdc94f116c0fcb2ba10fdb8c (patch)
treeadb1b68a0969dcad53533ce38b0477f650ca30f3 /lib
parent8337a375dd5bbe6b1dab4b711a5fdbc1664cb298 (diff)
compiler warning fix
Diffstat (limited to 'lib')
-rw-r--r--lib/hostip4.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/hostip4.c b/lib/hostip4.c
index 877baa2ca..273703de5 100644
--- a/lib/hostip4.c
+++ b/lib/hostip4.c
@@ -134,6 +134,10 @@ Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn,
*waitp = 0; /* don't wait, we act synchronously */
+#if defined(HAVE_GETHOSTBYNAME_R_3) || defined(HAVE_GETHOSTBYNAME_R_6)
+ int res = ERANGE;
+#endif
+
if(1 == Curl_inet_pton(AF_INET, hostname, &in))
/* This is a dotted IP address 123.123.123.123-style */
return Curl_ip2addr(in, hostname, port);
@@ -146,7 +150,6 @@ Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn,
*/
else {
int h_errnop;
- int res=ERANGE;
buf = (struct hostent *)calloc(CURL_HOSTENT_SIZE, 1);
if(!buf)
@@ -159,7 +162,6 @@ Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn,
#ifdef HAVE_GETHOSTBYNAME_R_5
/* Solaris, IRIX and more */
- (void)res; /* prevent compiler warning */
h = gethostbyname_r(hostname,
(struct hostent *)buf,
(char *)buf + sizeof(struct hostent),