aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZandra <[email protected]>2015-11-24 10:45:32 +0100
committerZandra <[email protected]>2015-11-24 10:45:32 +0100
commit738f6c5e2ac46fea4715225ff4a97ef95ced4ba9 (patch)
treedde9bda519fd55c782f94381a41e2908273395d2
parent82faec2369f8a13311e3a472788d19cc2bce6337 (diff)
parent87d29a0bc06345a2e72702a87f200bb5de85ab10 (diff)
downloadotp-738f6c5e2ac46fea4715225ff4a97ef95ced4ba9.tar.gz
otp-738f6c5e2ac46fea4715225ff4a97ef95ced4ba9.tar.bz2
otp-738f6c5e2ac46fea4715225ff4a97ef95ced4ba9.zip
Merge branch 'maint'
-rw-r--r--lib/erl_interface/src/connect/ei_resolve.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/erl_interface/src/connect/ei_resolve.c b/lib/erl_interface/src/connect/ei_resolve.c
index 3f1be2b17d..6381b02393 100644
--- a/lib/erl_interface/src/connect/ei_resolve.c
+++ b/lib/erl_interface/src/connect/ei_resolve.c
@@ -601,6 +601,16 @@ struct hostent *ei_gethostbyaddr(const char *addr, int len, int type)
return gethostbyaddr(addr, len, type);
}
+/*
+ * Imprecise way to select the actually available gethostbyname_r and
+ * gethostbyaddr_r.
+ *
+ * TODO: check this properly in configure.in
+ */
+#if (defined(__linux__) || (__FreeBSD_version >= 602000) || defined(__DragonFly__))
+ #define HAVE_GETHOSTBYADDR_R_8 1
+#endif
+
struct hostent *ei_gethostbyaddr_r(const char *addr,
int length,
int type,
@@ -616,7 +626,7 @@ struct hostent *ei_gethostbyaddr_r(const char *addr,
#ifndef HAVE_GETHOSTBYNAME_R
return my_gethostbyaddr_r(addr,length,type,hostp,buffer,buflen,h_errnop);
#else
-#if (defined(__GLIBC__) || (__FreeBSD_version >= 602000) || defined(__DragonFly__))
+#ifdef HAVE_GETHOSTBYADDR_R_8
struct hostent *result;
gethostbyaddr_r(addr, length, type, hostp, buffer, buflen, &result,
@@ -643,7 +653,7 @@ struct hostent *ei_gethostbyname_r(const char *name,
#ifndef HAVE_GETHOSTBYNAME_R
return my_gethostbyname_r(name,hostp,buffer,buflen,h_errnop);
#else
-#if (defined(__GLIBC__) || (__FreeBSD_version >= 602000) || defined(__DragonFly__) || defined(__ANDROID__))
+#ifdef HAVE_GETHOSTBYADDR_R_8
struct hostent *result;
gethostbyname_r(name, hostp, buffer, buflen, &result, h_errnop);