]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix compilation of wxGethostbyname_r() and wxGethostbyaddr_r() under AIX.
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 31 Oct 2011 14:24:51 +0000 (14:24 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 31 Oct 2011 14:24:51 +0000 (14:24 +0000)
gethostbyname_r() and gethostbyaddr_r() functions return int, not hostent*,
under AIX so assign their return value to the error indicator.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69615 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/sckaddr.cpp

index 79cc6c4cac8c02565b6e5a1d3cd1a1ae88658658..121e8b0d7f5a3b0a18a3afae15eb1ffb976685dc 100644 (file)
@@ -273,8 +273,8 @@ hostent *wxGethostbyname_r(const char *hostname,
 #elif defined(HAVE_FUNC_GETHOSTBYNAME_R_5)
     he = gethostbyname_r(hostname, h, buffer, size, err);
 #elif defined(HAVE_FUNC_GETHOSTBYNAME_R_3)
-    he = gethostbyname_r(hostname, h,  &buffer);
-    *err = h_errno;
+    *err = gethostbyname_r(hostname, h,  &buffer);
+    he = h;
 #elif defined(HAVE_GETHOSTBYNAME)
     wxLOCK_GETBY_MUTEX(name);
 
@@ -304,8 +304,8 @@ hostent *wxGethostbyaddr_r(const char *addr_buf,
 #elif defined(HAVE_FUNC_GETHOSTBYADDR_R_5)
     he = gethostbyaddr_r(addr_buf, buf_size, proto, h, buffer, size, err);
 #elif defined(HAVE_FUNC_GETHOSTBYADDR_R_3)
-    he = gethostbyaddr_r(addr_buf, buf_size, proto, h, buffer);
-    *err = h_errno;
+    *err = gethostbyaddr_r(addr_buf, buf_size, proto, h, &buffer);
+    he = h;
 #elif defined(HAVE_GETHOSTBYADDR)
     wxLOCK_GETBY_MUTEX(addr);