From 13202a4873377780ec5933e2450d15baff6e5a35 Mon Sep 17 00:00:00 2001 From: Amitay Isaacs Date: Tue, 31 Jan 2017 14:50:53 +1100 Subject: [PATCH 1/2] ctdb-tests: Do not build mutex test if robust mutexes are not supported BUG: https://bugzilla.samba.org/show_bug.cgi?id=12469 Signed-off-by: Amitay Isaacs --- ctdb/wscript | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ctdb/wscript b/ctdb/wscript index bc696c5..45a23d2 100644 --- a/ctdb/wscript +++ b/ctdb/wscript @@ -831,10 +831,11 @@ def build(bld): ib_deps, install_path='${CTDB_TEST_LIBEXECDIR}') - bld.SAMBA_BINARY('test_mutex_raw', - source='tests/src/test_mutex_raw.c', - deps='pthread', - install_path='${CTDB_TEST_LIBEXECDIR}') + if bld.env.HAVE_ROBUST_MUTEXES: + bld.SAMBA_BINARY('test_mutex_raw', + source='tests/src/test_mutex_raw.c', + deps='pthread', + install_path='${CTDB_TEST_LIBEXECDIR}') test_subdirs = [ 'complex', -- 2.9.3 From 16552253d88a026fc15055e498e45bd475e5b3e7 Mon Sep 17 00:00:00 2001 From: Amitay Isaacs Date: Tue, 31 Jan 2017 16:49:14 +1100 Subject: [PATCH 2/2] ctdb-tests: Use replace headers instead of system headers BUG: https://bugzilla.samba.org/show_bug.cgi?id=12469 This ensures that PTHREAD_MUTEX_ROBUST and pthread_mutexattr_setrobust are always defined. Signed-off-by: Amitay Isaacs --- ctdb/tests/src/test_mutex_raw.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/ctdb/tests/src/test_mutex_raw.c b/ctdb/tests/src/test_mutex_raw.c index 8e3cae3..2117d93 100644 --- a/ctdb/tests/src/test_mutex_raw.c +++ b/ctdb/tests/src/test_mutex_raw.c @@ -38,19 +38,11 @@ * If no pid is printed, then no process is holding the mutex. */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "replace.h" +#include "system/filesys.h" +#include "system/wait.h" +#include "system/shmem.h" +#include "system/threads.h" int pthread_mutex_consistent_np(pthread_mutex_t *); -- 2.9.3