diff options
author | Volker Lendecke <vl@samba.org> | 2014-09-30 11:04:21 +0000 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2014-11-20 16:23:05 +0100 |
commit | 911439639a2caa17a9680cb297e9fe26eba56149 (patch) | |
tree | b598db1160e4bbdfdfdeb2a9e9fa67f6eb327151 /lib/tdb_wrap | |
parent | c8d05e934ea03fffbc34944d2d51a016b89a7eca (diff) | |
download | samba-911439639a2caa17a9680cb297e9fe26eba56149.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>
Diffstat (limited to 'lib/tdb_wrap')
-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 { |