From: Vadim Zeitlin Date: Thu, 19 Feb 2009 14:01:26 +0000 (+0000) Subject: another AIX compilation fix: getservbyname_r() returns int, not servent* there X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/f6a25e0866e40e06ddab1b9cfd1d5b4dce39ff8c?ds=inline another AIX compilation fix: getservbyname_r() returns int, not servent* there git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59023 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/sckaddr.cpp b/src/common/sckaddr.cpp index 1eed735985..3ee1abd722 100644 --- a/src/common/sckaddr.cpp +++ b/src/common/sckaddr.cpp @@ -148,7 +148,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxUNIXaddress, wxSockAddress) typedef char wxGetservBuf[1024]; #endif -#if defined(wxHAS_MT_SAFE_GETBY_FUNCS) || !wxUSE_THREADS +#ifdef wxHAS_MT_SAFE_GETBY_FUNCS #define wxLOCK_GETBY_MUTEX(name) #else // may need mutexes to protect getxxxbyxxx() calls #if defined(HAVE_GETHOSTBYNAME) || \ @@ -392,7 +392,8 @@ servent *wxGetservbyname_r(const char *port, #elif defined(HAVE_FUNC_GETSERVBYNAME_R_5) se = getservbyname_r(port, protocol, serv, buffer, size); #elif defined(HAVE_FUNC_GETSERVBYNAME_R_4) - se = getservbyname_r(port, protocol, serv, &buffer); + if ( getservbyname_r(port, protocol, serv, &buffer) != 0 ) + return NULL; #elif defined(HAVE_GETSERVBYNAME) wxLOCK_GETBY_MUTEX(serv);