diff options
author | Daniel Stenberg <daniel@haxx.se> | 2000-05-30 22:27:39 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2000-05-30 22:27:39 +0000 |
commit | 8d76ad6c8e235bf4f558b1c250886b0085ecd1fe (patch) | |
tree | ea059d8b9e82957155b26f2ca4b3ea899055c23d /lib/hostip.c | |
parent | 784c29c6c5fb53edb0c33b65d6a20902eaa7ef53 (diff) | |
download | curl-8d76ad6c8e235bf4f558b1c250886b0085ecd1fe.tar.gz |
Adjusted to the GETHOSTBYADDR_R_NARGS style
Diffstat (limited to 'lib/hostip.c')
-rw-r--r-- | lib/hostip.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/hostip.c b/lib/hostip.c index ca8bf916a..76a781148 100644 --- a/lib/hostip.c +++ b/lib/hostip.c @@ -120,10 +120,22 @@ struct hostent *GetHost(struct UrlData *data, else { int h_errnop; memset(buf,0,buf_size); /* workaround for gethostbyname_r bug in qnx nto */ +#if (GETHOSTBYNAME_R_NARGS < 6) + /* Solaris, IRIX and more */ if ((h = gethostbyname_r(hostname, (struct hostent *)buf,buf + sizeof(struct hostent),buf_size - - sizeof(struct hostent),&h_errnop)) == NULL ) { + sizeof(struct hostent),&h_errnop)) == NULL ) +#else + /* Linux */ + if( gethostbyname_r(hostname, + (struct hostent *)buf,buf + + sizeof(struct hostent),buf_size - + sizeof(struct hostent), + &h, /* DIFFERENCE */ + &h_errnop)) +#endif + { infof(data, "gethostbyname_r(2) failed for %s\n", hostname); } #else |