From 3d81871acc914a463033020a0875a07bc672d4d9 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Tue, 7 Jun 2016 08:02:31 +0200 Subject: [PATCH] lvm2: unbreak and update portability patch. --- srcpkgs/lvm2/patches/portability.patch | 44 +++++++------------------- 1 file changed, 11 insertions(+), 33 deletions(-) diff --git a/srcpkgs/lvm2/patches/portability.patch b/srcpkgs/lvm2/patches/portability.patch index e5751ba5221..6adf1b42593 100644 --- a/srcpkgs/lvm2/patches/portability.patch +++ b/srcpkgs/lvm2/patches/portability.patch @@ -2,40 +2,7 @@ Portability fixes: - Use fcntl.h for O_RDONLY and friends. - Only use mallinfo with glibc. -- Use PTHREAD_MUTEX_RECURSIVE rather than the _NP (non portable) variants. ---- lib/mm/memlock.c 2014-11-29 00:07:42.000000000 +0100 -+++ lib/mm/memlock.c 2014-12-28 08:25:12.424935165 +0100 -@@ -133,7 +133,7 @@ static void _touch_memory(void *mem, siz - - static void _allocate_memory(void) - { --#ifndef VALGRIND_POOL -+#if !defined(VALGRIND_POOL) && defined(__GLIBC__) - void *stack_mem; - struct rlimit limit; - int i, area = 0, missing = _size_malloc_tmp, max_areas = 32, hblks; - ---- daemons/lvmetad/lvmetad-core.c 2014-11-29 00:07:42.000000000 +0100 -+++ daemons/lvmetad/lvmetad-core.c 2014-12-28 08:29:16.406946052 +0100 -@@ -124,7 +124,7 @@ static struct dm_config_tree *lock_vg(lv - if (!(vg = dm_hash_lookup(s->lock.vg, id))) { - if (!(vg = malloc(sizeof(pthread_mutex_t))) || - pthread_mutexattr_init(&rec) || -- pthread_mutexattr_settype(&rec, PTHREAD_MUTEX_RECURSIVE_NP) || -+ pthread_mutexattr_settype(&rec, PTHREAD_MUTEX_RECURSIVE) || - pthread_mutex_init(vg, &rec)) - goto bad; - if (!dm_hash_insert(s->lock.vg, id, vg)) { -@@ -1152,7 +1152,7 @@ static int init(daemon_state *s) - ls->log = s->log; - - pthread_mutexattr_init(&rec); -- pthread_mutexattr_settype(&rec, PTHREAD_MUTEX_RECURSIVE_NP); -+ pthread_mutexattr_settype(&rec, PTHREAD_MUTEX_RECURSIVE); - pthread_mutex_init(&ls->lock.pvid_to_pvmeta, &rec); - pthread_mutex_init(&ls->lock.vgid_to_metadata, &rec); - pthread_mutex_init(&ls->lock.pvid_to_vgid, NULL); --- libdaemon/server/daemon-server.c 2014-11-29 00:07:42.000000000 +0100 +++ libdaemon/server/daemon-server.c 2014-12-28 08:22:40.985928408 +0100 @@ -14,6 +14,7 @@ @@ -47,3 +14,14 @@ Portability fixes: #include #include +--- lib/mm/memlock.c.orig 2016-06-07 08:00:46.557058318 +0200 ++++ lib/mm/memlock.c 2016-06-07 08:01:25.453505793 +0200 +@@ -150,7 +150,7 @@ static void _touch_memory(void *mem, siz + + static void _allocate_memory(void) + { +-#ifndef VALGRIND_POOL ++#if !defined(VALGRIND_POOL) && defined(__GLIBC__) + void *stack_mem; + struct rlimit limit; + int i, area = 0, missing = _size_malloc_tmp, max_areas = 32, hblks;