aboutsummaryrefslogtreecommitdiff
path: root/ipv6/miredo/patches/001-fix-musl-pthread-non-portable.patch
blob: bbaa54c4d7f384e833eef783f1451a9520f9b718 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
--- a/libteredo/debug.h	2009-02-28 23:17:14.000000000 +0300
+++ b/libteredo/debug.h	2019-04-07 01:46:48.235087395 +0300
@@ -43,8 +43,10 @@
 #  ifdef __linux__
 #   include <errno.h>
 #   include <assert.h>
-#   undef PTHREAD_MUTEX_INITIALIZER
-#   define PTHREAD_MUTEX_INITIALIZER PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
+#   if defined(PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP)
+#     undef PTHREAD_MUTEX_INITIALIZER
+#     define PTHREAD_MUTEX_INITIALIZER PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
+#   endif
 
 static inline int
 d_pthread_mutex_init (pthread_mutex_t *mutex, pthread_mutexattr_t *pattr)
@@ -57,7 +59,7 @@
 		pthread_mutexattr_init (&attr);
 	}
 
-	pthread_mutexattr_settype (pattr, PTHREAD_MUTEX_ERRORCHECK_NP);
+	pthread_mutexattr_settype (pattr, PTHREAD_MUTEX_ERRORCHECK);
 	int res = pthread_mutex_init (mutex, pattr);
 
 	if (pattr == &attr)