summaryrefslogtreecommitdiff
path: root/lib/replace/system
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2015-06-12 11:01:21 +0200
committerStefan Metzmacher <metze@samba.org>2015-06-12 17:08:20 +0200
commit34cf1d213ec0261af41ef6a16f5b37e5015c614b (patch)
tree70b66342f1c884fd40e8fa932328e52d796afd5c /lib/replace/system
parentff072a633660780cf72d204f4620c664957a6072 (diff)
downloadsamba-34cf1d213ec0261af41ef6a16f5b37e5015c614b.tar.gz
lib/replace: fix PTHREAD_MUTEX_ROBUST fallback to PTHREAD_MUTEX_ROBUST_NP on solaris 11
Without this we got the following defines in config.h: #define HAVE_DECL_PTHREAD_MUTEXATTR_SETROBUST_NP 1 #define HAVE_DECL_PTHREAD_MUTEX_CONSISTENT_NP 1 #define HAVE_PTHREAD_MUTEXATTR_SETROBUST 1 #define HAVE_PTHREAD_MUTEX_CONSISTENT 1 #define HAVE_ROBUST_MUTEXES 1 #define USE_TDB_MUTEX_LOCKING 1 And the build failed with PTHREAD_MUTEX_ROBUST being unknown. Note that PTHREAD_MUTEX_ROBUST and PTHREAD_MUTEX_ROBUST_NP are enum values while they're defines on solaris 11 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11319 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'lib/replace/system')
-rw-r--r--lib/replace/system/threads.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/replace/system/threads.h b/lib/replace/system/threads.h
index 25d3502aa64..fe6d0fbac54 100644
--- a/lib/replace/system/threads.h
+++ b/lib/replace/system/threads.h
@@ -29,15 +29,12 @@
#if defined(HAVE_PTHREAD_MUTEXATTR_SETROBUST_NP) && \
!defined(HAVE_PTHREAD_MUTEXATTR_SETROBUST)
-
#define pthread_mutexattr_setrobust pthread_mutexattr_setrobust_np
+#endif
-/*
- * We assume that PTHREAD_MUTEX_ROBUST_NP goes along with
- * pthread_mutexattr_setrobust_np()
- */
+#if defined(HAVE_DECL_PTHREAD_MUTEX_ROBUST_NP) && \
+ !defined(HAVE_DECL_PTHREAD_MUTEX_ROBUST)
#define PTHREAD_MUTEX_ROBUST PTHREAD_MUTEX_ROBUST_NP
-
#endif
#if defined(HAVE_PTHREAD_MUTEX_CONSISTENT_NP) && \