summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2000-08-17 21:07:22 +0000
committerDaniel Stenberg <daniel@haxx.se>2000-08-17 21:07:22 +0000
commita8f99e792408d0a7b6a9c478b38532b8c5fdc457 (patch)
tree586dde49c68ef2f70916f860bd43545a338676a6
parentf8e916db467b2208a7fa472864ec7aff36850293 (diff)
downloadgnurl-a8f99e792408d0a7b6a9c478b38532b8c5fdc457.tar.gz
gnurl-a8f99e792408d0a7b6a9c478b38532b8c5fdc457.tar.bz2
gnurl-a8f99e792408d0a7b6a9c478b38532b8c5fdc457.zip
the gethostbyname_r() usage was improved by Fred Noz
-rw-r--r--lib/hostip.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/hostip.c b/lib/hostip.c
index 6bccab8fc..3ae21cb1b 100644
--- a/lib/hostip.c
+++ b/lib/hostip.c
@@ -62,6 +62,8 @@
#include "urldata.h"
#include "sendf.h"
+#define _REENTRANT
+
#ifdef HAVE_INET_NTOA_R
#include "inet_ntoa_r.h"
#endif
@@ -139,7 +141,7 @@ struct hostent *GetHost(struct UrlData *data,
&h_errnop))
#endif
#ifdef HAVE_GETHOSTBYNAME_R_3
- /* AIX, Digital Unix, more? */
+ /* AIX, Digital Unix, HPUX 10, more? */
/* August 4th, 2000. I don't have any such system around so I write this
blindly in hope it might work or that someone else will help me fix
@@ -147,8 +149,8 @@ struct hostent *GetHost(struct UrlData *data,
h = gethostbyname_r(hostname,
(struct hostent *)buf,
- (struct hostent_data *) buf + sizeof(struct hostent));
- *h_errnop= errno; /* we don't deal with this, but set it anyway */
+ (struct hostent_data *)(buf + sizeof(struct hostent)));
+ h_errnop= errno; /* we don't deal with this, but set it anyway */
if(NULL == h)
#endif
{