summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-01-20 10:33:54 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-01-20 10:33:54 +0100
commite7057033beafedb857c45d5b32d9622b0ce545e8 (patch)
tree963143d92eb73fb924e7085dd6970aa3b3ad8320
parentSome more loplugin:cstylecast: testtools (diff)
downloadcore-e7057033beafedb857c45d5b32d9622b0ce545e8.tar.gz
core-e7057033beafedb857c45d5b32d9622b0ce545e8.zip
Fix for Android gethostbyaddr
Change-Id: Icc8f5f71f07d0afb016b6188daea26068db93769
-rw-r--r--sal/osl/unx/socket.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/sal/osl/unx/socket.cxx b/sal/osl/unx/socket.cxx
index ce8a4f38d8b5..c8186864e5cd 100644
--- a/sal/osl/unx/socket.cxx
+++ b/sal/osl/unx/socket.cxx
@@ -961,7 +961,10 @@ oslHostAddr SAL_CALL osl_createHostAddrByAddr (const oslSocketAddr pAddr)
if (sin->sin_addr.s_addr == htonl(INADDR_ANY))
return ((oslHostAddr)NULL);
- he= gethostbyaddr(&sin->sin_addr,
+ char const * addr = reinterpret_cast<char const *>(&sin->sin_addr);
+ // at least some Androids apparently have a gethostbyaddr with char*
+ // instead of void* argument
+ he= gethostbyaddr(addr,
sizeof (sin->sin_addr),
sin->sin_family);
return _osl_hostentToHostAddr (he);