From 6677f122a1bf48ec0d7902e0d2accdeacb0d0d12 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 31 Oct 2011 14:24:51 +0000 Subject: [PATCH] Fix compilation of wxGethostbyname_r() and wxGethostbyaddr_r() under AIX. 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 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/common/sckaddr.cpp b/src/common/sckaddr.cpp index 79cc6c4cac..121e8b0d7f 100644 --- a/src/common/sckaddr.cpp +++ b/src/common/sckaddr.cpp @@ -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); -- 2.49.0