diff options
author | Sverker Eriksson <[email protected]> | 2018-04-18 11:31:53 +0200 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2018-04-18 11:31:53 +0200 |
commit | 3c8c8158de1b0f1880d588c1169be6a2f727c379 (patch) | |
tree | d6cc92e9e62760032ae595dbfa8d41b1bf0fbc1c /lib/erl_interface/src/connect/ei_resolve.c | |
parent | 44b09e036b31b29dddc3b178e8f6b9fc96a9a874 (diff) | |
download | otp-3c8c8158de1b0f1880d588c1169be6a2f727c379.tar.gz otp-3c8c8158de1b0f1880d588c1169be6a2f727c379.tar.bz2 otp-3c8c8158de1b0f1880d588c1169be6a2f727c379.zip |
erl_interface: Fix ei_connect
when ei_gethostbyname_r returns ERANGE.
Diffstat (limited to 'lib/erl_interface/src/connect/ei_resolve.c')
-rw-r--r-- | lib/erl_interface/src/connect/ei_resolve.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/erl_interface/src/connect/ei_resolve.c b/lib/erl_interface/src/connect/ei_resolve.c index fd0c659373..2757735d39 100644 --- a/lib/erl_interface/src/connect/ei_resolve.c +++ b/lib/erl_interface/src/connect/ei_resolve.c @@ -645,8 +645,11 @@ struct hostent *ei_gethostbyname_r(const char *name, #else #if (defined(__GLIBC__) || defined(__linux__) || (__FreeBSD_version >= 602000) || defined(__DragonFly__) || defined(__ANDROID__)) struct hostent *result; + int err; - gethostbyname_r(name, hostp, buffer, buflen, &result, h_errnop); + err = gethostbyname_r(name, hostp, buffer, buflen, &result, h_errnop); + if (err == ERANGE) + *h_errnop = err; return result; #else |