1) Make sure that multithreaded coding using
gethostbyname(3)/gethostbyaddr(3) is used under FreeBSD. 2) Futhermore, insure that it is properly detected whether reentrant versions of the aforementioned functions are available; and, that the appropriate code is used on either case. 3) Bump PORTREVISION Submitted by: spiralvoice <spiralvoice@users.sourceforge.net> [1] Reviewed by: freebsd-ports (3 days silence)
This commit is contained in:
parent
dea3c8eced
commit
a60e09632b
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=153834
4 changed files with 104 additions and 2 deletions
|
@ -7,7 +7,7 @@
|
|||
|
||||
PORTNAME= mldonkey
|
||||
PORTVERSION= 2.7.2
|
||||
PORTREVISION= 1
|
||||
PORTREVISION= 2
|
||||
CATEGORIES+= net
|
||||
MASTER_SITES= ${MASTER_SITE_SAVANNAH}
|
||||
MASTER_SITE_SUBDIR= ${PORTNAME}
|
||||
|
@ -90,6 +90,11 @@ PKGMESSAGE= ${WRKDIR}/pkg-message
|
|||
USE_GCC= 3.4
|
||||
.endif
|
||||
|
||||
# FreeBSD has reentrant dns code
|
||||
.if ( ((${OSVERSION} >= 504102) && (${OSVERSION} < 600000)) || (${OSVERSION} >= 600029) )
|
||||
PTHREAD_CFLAGS+= -D_REENTRANT
|
||||
.endif
|
||||
|
||||
### Development version
|
||||
## Thus, we will use non standard threading library
|
||||
## We will switch from libpthread to libthr which should produce
|
||||
|
|
|
@ -0,0 +1,46 @@
|
|||
--- src/utils/lib/stubs_c.c.orig Wed Jan 4 12:23:37 2006
|
||||
+++ src/utils/lib/stubs_c.c Mon Jan 16 14:14:38 2006
|
||||
@@ -28,6 +28,11 @@
|
||||
#include <inttypes.h>
|
||||
#endif
|
||||
|
||||
+/* For proper FreeBSD version identification */
|
||||
+#if defined(HAVE_SYS_PARAM_H)
|
||||
+#include <sys/param.h>
|
||||
+#endif
|
||||
+
|
||||
#define lseek XXXXXXXXX
|
||||
#define read XXXXXXXXX
|
||||
#define ftruncate XXXXXXXXX
|
||||
@@ -683,7 +688,7 @@
|
||||
|
||||
#define NETDB_BUFFER_SIZE 10000
|
||||
|
||||
-#ifdef _WIN32
|
||||
+#if ( defined(__FreeBSD_version) && ( ((__FreeBSD_version >= 504102) && (__FreeBSD_version < 600000)) || (__FreeBSD_version >= 600029) ) )
|
||||
#define GETHOSTBYADDR_IS_REENTRANT 1
|
||||
#define GETHOSTBYNAME_IS_REENTRANT 1
|
||||
#endif
|
||||
@@ -738,11 +743,11 @@
|
||||
if (rc != 0) hp = NULL;
|
||||
}
|
||||
#else
|
||||
-#ifdef GETHOSTBYNAME_IS_REENTRANT
|
||||
+#ifndef GETHOSTBYNAME_IS_REENTRANT
|
||||
enter_blocking_section();
|
||||
#endif
|
||||
hp = gethostbyname(hostname);
|
||||
-#ifdef GETHOSTBYNAME_IS_REENTRANT
|
||||
+#ifndef GETHOSTBYNAME_IS_REENTRANT
|
||||
leave_blocking_section();
|
||||
#endif
|
||||
#endif
|
||||
@@ -787,7 +792,7 @@
|
||||
End_roots();
|
||||
}
|
||||
|
||||
-#if !defined(HAVE_PTHREAD) || !(HAS_GETHOSTBYNAME_R || GETHOSTBYNAME_IS_REENTRANT)
|
||||
+#if !defined(HAVE_PTHREAD) || (!(HAS_GETHOSTBYNAME_R || GETHOSTBYNAME_IS_REENTRANT) && !defined(HAS_SIGWAIT))
|
||||
|
||||
value ml_ip_job_start(value job_v)
|
||||
{
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
PORTNAME= mldonkey
|
||||
PORTVERSION= 2.7.2
|
||||
PORTREVISION= 1
|
||||
PORTREVISION= 2
|
||||
CATEGORIES+= net
|
||||
MASTER_SITES= ${MASTER_SITE_SAVANNAH}
|
||||
MASTER_SITE_SUBDIR= ${PORTNAME}
|
||||
|
@ -90,6 +90,11 @@ PKGMESSAGE= ${WRKDIR}/pkg-message
|
|||
USE_GCC= 3.4
|
||||
.endif
|
||||
|
||||
# FreeBSD has reentrant dns code
|
||||
.if ( ((${OSVERSION} >= 504102) && (${OSVERSION} < 600000)) || (${OSVERSION} >= 600029) )
|
||||
PTHREAD_CFLAGS+= -D_REENTRANT
|
||||
.endif
|
||||
|
||||
### Development version
|
||||
## Thus, we will use non standard threading library
|
||||
## We will switch from libpthread to libthr which should produce
|
||||
|
|
46
net/mldonkey-devel/files/patch-src__utils__lib__stubs_c.c
Normal file
46
net/mldonkey-devel/files/patch-src__utils__lib__stubs_c.c
Normal file
|
@ -0,0 +1,46 @@
|
|||
--- src/utils/lib/stubs_c.c.orig Wed Jan 4 12:23:37 2006
|
||||
+++ src/utils/lib/stubs_c.c Mon Jan 16 14:14:38 2006
|
||||
@@ -28,6 +28,11 @@
|
||||
#include <inttypes.h>
|
||||
#endif
|
||||
|
||||
+/* For proper FreeBSD version identification */
|
||||
+#if defined(HAVE_SYS_PARAM_H)
|
||||
+#include <sys/param.h>
|
||||
+#endif
|
||||
+
|
||||
#define lseek XXXXXXXXX
|
||||
#define read XXXXXXXXX
|
||||
#define ftruncate XXXXXXXXX
|
||||
@@ -683,7 +688,7 @@
|
||||
|
||||
#define NETDB_BUFFER_SIZE 10000
|
||||
|
||||
-#ifdef _WIN32
|
||||
+#if ( defined(__FreeBSD_version) && ( ((__FreeBSD_version >= 504102) && (__FreeBSD_version < 600000)) || (__FreeBSD_version >= 600029) ) )
|
||||
#define GETHOSTBYADDR_IS_REENTRANT 1
|
||||
#define GETHOSTBYNAME_IS_REENTRANT 1
|
||||
#endif
|
||||
@@ -738,11 +743,11 @@
|
||||
if (rc != 0) hp = NULL;
|
||||
}
|
||||
#else
|
||||
-#ifdef GETHOSTBYNAME_IS_REENTRANT
|
||||
+#ifndef GETHOSTBYNAME_IS_REENTRANT
|
||||
enter_blocking_section();
|
||||
#endif
|
||||
hp = gethostbyname(hostname);
|
||||
-#ifdef GETHOSTBYNAME_IS_REENTRANT
|
||||
+#ifndef GETHOSTBYNAME_IS_REENTRANT
|
||||
leave_blocking_section();
|
||||
#endif
|
||||
#endif
|
||||
@@ -787,7 +792,7 @@
|
||||
End_roots();
|
||||
}
|
||||
|
||||
-#if !defined(HAVE_PTHREAD) || !(HAS_GETHOSTBYNAME_R || GETHOSTBYNAME_IS_REENTRANT)
|
||||
+#if !defined(HAVE_PTHREAD) || (!(HAS_GETHOSTBYNAME_R || GETHOSTBYNAME_IS_REENTRANT) && !defined(HAS_SIGWAIT))
|
||||
|
||||
value ml_ip_job_start(value job_v)
|
||||
{
|
Loading…
Reference in a new issue