another AIX compilation fix: getservbyname_r() returns int, not servent* there
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 19 Feb 2009 14:01:26 +0000 (14:01 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 19 Feb 2009 14:01:26 +0000 (14:01 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59023 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/sckaddr.cpp

index 1eed7359859ba50b37e0b56f79a06d14dc129a2e..3ee1abd7225b531ff8ba515a11045d07b6073a39 100644 (file)
@@ -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);