You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

74 lines
3.1 KiB

Index: mozilla/nsprpub/pr/include/md/_freebsd.h
--- mozilla/nsprpub/pr/include/md/_freebsd.h.orig 2004-11-22 22:24:53 +0100
+++ mozilla/nsprpub/pr/include/md/_freebsd.h 2008-02-07 19:15:24 +0100
@@ -43,6 +43,7 @@
#if __FreeBSD__ >= 2
#include <osreldate.h> /* for __FreeBSD_version */
#endif
+#include <sys/param.h>
#include <sys/syscall.h>
#define PR_LINKER_ARCH "freebsd"
Index: mozilla/nsprpub/pr/include/md/_pth.h
--- mozilla/nsprpub/pr/include/md/_pth.h.orig 2006-12-08 23:58:13 +0100
+++ mozilla/nsprpub/pr/include/md/_pth.h 2008-02-07 19:15:24 +0100
@@ -84,7 +84,7 @@
#define _PT_PTHREAD_MUTEXATTR_DESTROY(x) /* */
#define _PT_PTHREAD_MUTEX_INIT(m, a) (memset(&(m), 0, sizeof(m)), \
pthread_mutex_init(&(m), NULL))
-#define _PT_PTHREAD_MUTEX_IS_LOCKED(m) (EBUSY == pthread_mutex_trylock(&(m)))
+#define _PT_PTHREAD_MUTEX_IS_LOCKED(m) (0 != pthread_mutex_trylock(&(m)))
#define _PT_PTHREAD_CONDATTR_INIT(x) 0
#define _PT_PTHREAD_CONDATTR_DESTROY(x) /* */
#define _PT_PTHREAD_COND_INIT(m, a) (memset(&(m), 0, sizeof(m)), \
@@ -96,7 +96,7 @@
#if defined(FREEBSD)
#define _PT_PTHREAD_MUTEX_IS_LOCKED(m) pt_pthread_mutex_is_locked(&(m))
#else
-#define _PT_PTHREAD_MUTEX_IS_LOCKED(m) (EBUSY == pthread_mutex_trylock(&(m)))
+#define _PT_PTHREAD_MUTEX_IS_LOCKED(m) (0 != pthread_mutex_trylock(&(m)))
#endif
#if defined(DARWIN)
#define _PT_PTHREAD_CONDATTR_INIT(x) 0
Index: mozilla/nsprpub/pr/src/md/unix/unix.c
--- mozilla/nsprpub/pr/src/md/unix/unix.c.orig 2006-04-05 22:57:15 +0200
+++ mozilla/nsprpub/pr/src/md/unix/unix.c 2008-02-07 19:20:57 +0100
@@ -68,7 +68,7 @@
* PRInt32* pointer to a _PRSockLen_t* pointer.
*/
#if defined(HAVE_SOCKLEN_T) \
- || (defined(__GLIBC__) && __GLIBC__ >= 2)
+ || (defined(__GLIBC__) && __GLIBC__ >= 2) || defined(FREEBSD)
#define _PRSockLen_t socklen_t
#elif defined(IRIX) || defined(HPUX) || defined(OSF1) || defined(SOLARIS) \
|| defined(AIX4_1) || defined(LINUX) || defined(SONY) \
@@ -76,7 +76,7 @@
|| defined(SUNOS4) || defined(NCR) || defined(DARWIN) \
|| defined(NEXTSTEP) || defined(QNX)
#define _PRSockLen_t int
-#elif (defined(AIX) && !defined(AIX4_1)) || defined(FREEBSD) \
+#elif (defined(AIX) && !defined(AIX4_1)) \
|| defined(NETBSD) || defined(OPENBSD) || defined(UNIXWARE) \
|| defined(DGUX) || defined(VMS) || defined(NTO) || defined(RISCOS)
#define _PRSockLen_t size_t
Index: mozilla/nsprpub/pr/src/pthreads/ptio.c
--- mozilla/nsprpub/pr/src/pthreads/ptio.c.orig 2008-01-13 02:27:16 +0100
+++ mozilla/nsprpub/pr/src/pthreads/ptio.c 2008-02-07 19:15:24 +0100
@@ -3475,6 +3475,17 @@
&on, sizeof(on));
}
#endif
+#if (defined(_PR_INET6_PROBE) || defined(_PR_INET6)) && \
+ defined(__FreeBSD__) && defined(IPV6_V6ONLY)
+ if (domain == PR_AF_INET6) {
+ int opt = 0;
+ if (setsockopt(osfd, IPPROTO_IPV6, IPV6_V6ONLY,
+ &opt, sizeof(opt))) {
+ close(osfd);
+ return NULL;
+ }
+ }
+#endif
fd = pt_SetMethods(osfd, ftype, PR_FALSE, PR_FALSE);
if (fd == NULL) close(osfd);
}