diff options
author | Volker Lendecke <vl@samba.org> | 2014-09-30 11:04:21 +0000 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2015-01-12 22:28:31 +0100 |
commit | 4701d74618c639acec895850c4720d53f29dece5 (patch) | |
tree | b7db61d805be6859d8798dd862d6bb771d43935b | |
parent | c6dc67a10b2d728b44acde82b78fe0b659a52518 (diff) | |
download | samba-4701d74618c639acec895850c4720d53f29dece5.tar.gz |
tdb_wrap: Make mutexes easier to use
This patch makes sure we work fine and open without mutexes if they
are not supported.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
(cherry picked from commit 911439639a2caa17a9680cb297e9fe26eba56149)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11032
Autobuild-User(v4-2-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-2-test): Mon Jan 12 22:28:31 CET 2015 on sn-devel-104
-rw-r--r-- | lib/tdb_wrap/tdb_wrap.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/tdb_wrap/tdb_wrap.c b/lib/tdb_wrap/tdb_wrap.c index f2f32d1f085..e762b334efe 100644 --- a/lib/tdb_wrap/tdb_wrap.c +++ b/lib/tdb_wrap/tdb_wrap.c @@ -149,6 +149,13 @@ struct tdb_wrap *tdb_wrap_open(TALLOC_CTX *mem_ctx, } if (w == NULL) { + + if (tdb_flags & TDB_MUTEX_LOCKING) { + if (!tdb_runtime_check_for_robust_mutexes()) { + tdb_flags &= ~TDB_MUTEX_LOCKING; + } + } + w = tdb_wrap_private_open(result, name, hash_size, tdb_flags, open_flags, mode); } else { |