summaryrefslogtreecommitdiff
path: root/devel/nspr/files/patch-bug782111
diff options
context:
space:
mode:
Diffstat (limited to 'devel/nspr/files/patch-bug782111')
-rw-r--r--devel/nspr/files/patch-bug78211135
1 files changed, 35 insertions, 0 deletions
diff --git a/devel/nspr/files/patch-bug782111 b/devel/nspr/files/patch-bug782111
new file mode 100644
index 000000000000..cddbcfd5541c
--- /dev/null
+++ b/devel/nspr/files/patch-bug782111
@@ -0,0 +1,35 @@
+--- ../pr/src/pthreads/ptthread.c
++++ ../pr/src/pthreads/ptthread.c
+@@ -21,6 +21,10 @@
+ #include <signal.h>
+ #include <dlfcn.h>
+
++#if defined(OPENBSD) || defined(FREEBSD) || defined(DRAGONFLY)
++#include <pthread_np.h>
++#endif
++
+ #ifdef SYMBIAN
+ /* In Open C sched_get_priority_min/max do not work properly, so we undefine
+ * _POSIX_THREAD_PRIORITY_SCHEDULING here.
+@@ -1619,7 +1623,7 @@ PR_IMPLEMENT(PRStatus) PR_SetCurrentThreadName(const char *name)
+ {
+ PRThread *thread;
+ size_t nameLen;
+- int result;
++ int result = 0;
+
+ if (!name) {
+ PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0);
+@@ -1637,8 +1641,10 @@ PR_IMPLEMENT(PRStatus) PR_SetCurrentThreadName(const char *name)
+ return PR_FAILURE;
+ memcpy(thread->name, name, nameLen + 1);
+
+-#if defined(OPENBSD) || defined(FREEBSD)
+- result = pthread_set_name_np(thread->id, name);
++#if defined(OPENBSD) || defined(FREEBSD) || defined(DRAGONFLY)
++ pthread_set_name_np(thread->id, name);
++#elif defined(NETBSD)
++ pthread_setname_np(thread->id, "%s", name);
+ #else /* not BSD */
+ /*
+ * On OSX, pthread_setname_np is only available in 10.6 or later, so test