[Libreoffice-commits] core.git: sal/osl

Stephan Bergmann sbergman at redhat.com
Tue Jan 20 01:34:40 PST 2015


 sal/osl/unx/socket.cxx |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit e7057033beafedb857c45d5b32d9622b0ce545e8
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Jan 20 10:33:54 2015 +0100

    Fix for Android gethostbyaddr
    
    Change-Id: Icc8f5f71f07d0afb016b6188daea26068db93769

diff --git a/sal/osl/unx/socket.cxx b/sal/osl/unx/socket.cxx
index ce8a4f3..c818686 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);


More information about the Libreoffice-commits mailing list