blob: 969a15287e98b3b8a177519e24ac48902b808401 [file] [log] [blame]
Patrick Williamsb48b7b42016-08-17 15:04:38 -05001From c8a1b669cbff3eee367fd4db3389e337bc4c98ba Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 20 Jan 2016 04:46:26 +0000
4Subject: [PATCH 2/4] use PTHREAD_MUTEX_RECURSIVE instead of
5 PTHREAD_MUTEX_RECURSIVE_NP
6
7PTHREAD_MUTEX_RECURSIVE_NP was used for compatibility with old glibc.
8Although due to the_GNU_SOURCES define the portable,
9PTHREAD_MUTEX_RECURSIVE will be available for Linuxes since at least
101998. Simplify things giving us compatibility with musl which
11apparently does not provide the non-portable define.
12
13Signed-off-by: Khem Raj <raj.khem@gmail.com>
14---
15Upstream-Status: Pending
16
17 daemons/lvmetad/lvmetad-core.c | 4 ++--
18 1 file changed, 2 insertions(+), 2 deletions(-)
19
20diff --git a/daemons/lvmetad/lvmetad-core.c b/daemons/lvmetad/lvmetad-core.c
21index 7af9bde..63707c2 100644
22--- a/daemons/lvmetad/lvmetad-core.c
23+++ b/daemons/lvmetad/lvmetad-core.c
24@@ -300,7 +300,7 @@ static struct dm_config_tree *lock_vg(lvmetad_state *s, const char *id) {
25 if (!(vg = dm_hash_lookup(s->lock.vg, id))) {
26 if (!(vg = malloc(sizeof(pthread_mutex_t))) ||
27 pthread_mutexattr_init(&rec) ||
28- pthread_mutexattr_settype(&rec, PTHREAD_MUTEX_RECURSIVE_NP) ||
29+ pthread_mutexattr_settype(&rec, PTHREAD_MUTEX_RECURSIVE) ||
30 pthread_mutex_init(vg, &rec))
31 goto bad;
32 if (!dm_hash_insert(s->lock.vg, id, vg)) {
33@@ -2890,7 +2890,7 @@ static int init(daemon_state *s)
34 ls->log = s->log;
35
36 pthread_mutexattr_init(&rec);
37- pthread_mutexattr_settype(&rec, PTHREAD_MUTEX_RECURSIVE_NP);
38+ pthread_mutexattr_settype(&rec, PTHREAD_MUTEX_RECURSIVE);
39 pthread_mutex_init(&ls->lock.pvid_to_pvmeta, &rec);
40 pthread_mutex_init(&ls->lock.vgid_to_metadata, &rec);
41 pthread_mutex_init(&ls->lock.pvid_to_vgid, NULL);
42--
432.7.0
44