summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>2015-11-03 11:03:38 +0100
committerXavier Leroy <xavier.leroy@inria.fr>2015-11-03 11:03:38 +0100
commit3f3d8342ace92d2298d33619bbb11b7b05446cce (patch)
tree1f63f347cbb71edffaaf969a272051015b9367a9
parentbbd0ac54ab1c4aad955b26ca58ef52bae04938ae (diff)
downloadocaml-3f3d8342ace92d2298d33619bbb11b7b05446cce.tar.gz
otherlibs/unix: don't use 'h_errno' as a local variable
Under Glibc, 'h_errno' is a macro that expands to a system call, like 'errno'. Here, we just want a local variable.
-rw-r--r--otherlibs/unix/gethost.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/otherlibs/unix/gethost.c b/otherlibs/unix/gethost.c
index 0f04fb907a..13d2f032db 100644
--- a/otherlibs/unix/gethost.c
+++ b/otherlibs/unix/gethost.c
@@ -128,7 +128,7 @@ CAMLprim value unix_gethostbyname(value name)
#if HAS_GETHOSTBYNAME_R
struct hostent h;
char buffer[NETDB_BUFFER_SIZE];
- int h_errno;
+ int err;
#endif
#if HAS_GETHOSTBYNAME_R || GETHOSTBYNAME_IS_REENTRANT
@@ -140,14 +140,14 @@ CAMLprim value unix_gethostbyname(value name)
#if HAS_GETHOSTBYNAME_R == 5
{
enter_blocking_section();
- hp = gethostbyname_r(hostname, &h, buffer, sizeof(buffer), &h_errno);
+ hp = gethostbyname_r(hostname, &h, buffer, sizeof(buffer), &err);
leave_blocking_section();
}
#elif HAS_GETHOSTBYNAME_R == 6
{
int rc;
enter_blocking_section();
- rc = gethostbyname_r(hostname, &h, buffer, sizeof(buffer), &hp, &h_errno);
+ rc = gethostbyname_r(hostname, &h, buffer, sizeof(buffer), &hp, &err);
leave_blocking_section();
if (rc != 0) hp = NULL;
}