+2007-08-07 Marcus Mueller <znek@mulle-kybernetik.com>
+
+ * NGInternetSocketAddress.m: do not define USE_GETHOSTBYNAME_R on
+ FreeBSD (although HAVE_GETHOSTBYNAME_R is defined). It appears
+ gethostbyname() is thread safe on FreeBSD and there are 3 API
+ versions of gethostbyname_r(), which isn't worth the hassle
+ to check in this case. Changed code to consequently use
+ USE_GETHOSTBYNAME_R. (v4.7.52)
+
2006-07-04 Helge Hess <helge.hess@opengroupware.org>
* 64bit fixes (v4.5.51)
#include "NGInternetSocketDomain.h"
#include "common.h"
-#if defined(HAVE_GETHOSTBYNAME_R) && !defined(linux)
+#if defined(HAVE_GETHOSTBYNAME_R) && !defined(linux) && !defined(__FreeBSD__)
#define USE_GETHOSTBYNAME_R 1
#endif
#if USE_GETHOSTBYNAME_R
struct hostent hostEntityBuffer;
char buffer[8200];
-
+
hostEntity = gethostbyaddr_r((char *)&(sockAddr->sin_addr.s_addr),
4,
[[self domain] socketDomain],
BOOL didFail = NO;
int errorCode = 0;
int addrType = AF_INET;
-#if defined(HAVE_GETHOSTBYNAME_R) && !defined(linux)
+#if defined(USE_GETHOSTBYNAME_R)
char buffer[4096];
struct hostent hostEntity;
#else
struct hostent *hostEntity; // only valid during lock
#endif
-#if defined(HAVE_GETHOSTBYNAME_R) && !defined(linux)
+#if defined(USE_GETHOSTBYNAME_R)
if (gethostbyname_r(chost, &hostEntity,
buffer, sizeof(buffer), &errorCode) == NULL) {
didFail = YES;