aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/ltp/ltp/0030-lib-Use-PTHREAD_MUTEX_RECURSIVE-in-place-of-PTHREAD_.patch
blob: d2d6d76fd7d7c569b764f94ec4aebb0bd3a22ba1 (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
25
26
27
28
29
30
31
32
33
From 77c95dacffe90382a1f131c801ac569120d95949 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 8 Jan 2016 07:32:24 +0000
Subject: [PATCH 30/32] lib: Use PTHREAD_MUTEX_RECURSIVE in place of
 PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP for non-glibc

e.g. musl does not implement the _NP mutex types

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 lib/tst_res.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/tst_res.c b/lib/tst_res.c
index 5c1c58c..3244b5e 100644
--- a/lib/tst_res.c
+++ b/lib/tst_res.c
@@ -104,8 +104,11 @@ int TEST_ERRNO;
 	assert(strlen(buf) > 0);		\
 } while (0)
 
+#ifdef __GLIBC__
 static pthread_mutex_t tmutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
-
+#else
+static pthread_mutex_t tmutex = {  PTHREAD_MUTEX_RECURSIVE };
+#endif
 /*
  * Define local function prototypes.
  */
-- 
2.7.0