aboutsummaryrefslogtreecommitdiffstats
path: root/lib/erl_interface/src/connect
diff options
context:
space:
mode:
authorCalvin Buckley <[email protected]>2019-01-25 10:36:58 -0500
committerCalvin <[email protected]>2019-05-29 06:21:42 -0400
commit2318be71e96021613b1077acca66bba4fce0a71c (patch)
tree4b12f98111cc923fbe309c20d1a5fb8b39a9a6d4 /lib/erl_interface/src/connect
parenta839aaefd996032253f0f86fe23c4358386b70af (diff)
downloadotp-2318be71e96021613b1077acca66bba4fce0a71c.tar.gz
otp-2318be71e96021613b1077acca66bba4fce0a71c.tar.bz2
otp-2318be71e96021613b1077acca66bba4fce0a71c.zip
Don't use gethostbyname_r on AIX
Patch adapated from Bull's R15 SRPM.
Diffstat (limited to 'lib/erl_interface/src/connect')
-rw-r--r--lib/erl_interface/src/connect/ei_resolve.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/erl_interface/src/connect/ei_resolve.c b/lib/erl_interface/src/connect/ei_resolve.c
index 225fddc784..5a8ca0c567 100644
--- a/lib/erl_interface/src/connect/ei_resolve.c
+++ b/lib/erl_interface/src/connect/ei_resolve.c
@@ -55,6 +55,16 @@
#include "ei_resolve.h"
#include "ei_locking.h"
+/* AIX has a totally different signature (allegedly shared with some other
+ * Unices) that isn't compatible. It turns out that the _r version isn't
+ * thread-safe according to curl - but bizarrely, since AIX 4.3, libc
+ * is thread-safe in a manner that makes the normal gethostbyname OK
+ * for re-entrant use.
+ */
+#ifdef _AIX
+#undef HAVE_GETHOSTBYNAME_R
+#endif
+
#ifdef HAVE_GETHOSTBYNAME_R
int ei_init_resolve(void)
@@ -75,7 +85,7 @@ int ei_init_resolve(void)
static ei_mutex_t *ei_gethost_sem = NULL;
#endif /* _REENTRANT */
static int ei_resolve_initialized = 0;
-#ifndef __WIN32__
+#if !defined(__WIN32__) && !defined(_AIX)
int h_errno;
#endif