diff options
author | Zandra <[email protected]> | 2015-11-24 10:45:24 +0100 |
---|---|---|
committer | Zandra <[email protected]> | 2015-11-24 10:45:24 +0100 |
commit | 87d29a0bc06345a2e72702a87f200bb5de85ab10 (patch) | |
tree | 1ee9801764b71fb890568cc8388cf087f94e8aa7 /lib/erl_interface | |
parent | 517a545d9de0a434c486de1acdc891c6fc8e3309 (diff) | |
parent | 192c4a80c7d6fe9949aecb864901c4a3d9549f36 (diff) | |
download | otp-87d29a0bc06345a2e72702a87f200bb5de85ab10.tar.gz otp-87d29a0bc06345a2e72702a87f200bb5de85ab10.tar.bz2 otp-87d29a0bc06345a2e72702a87f200bb5de85ab10.zip |
Merge branch 'tuncer/musl' into maint
* tuncer/musl:
musl: fix gethostbyname_r/gethostbyaddr_ selection
Diffstat (limited to 'lib/erl_interface')
-rw-r--r-- | lib/erl_interface/src/connect/ei_resolve.c | 14 |
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); |