From 86df9ca15a4488bb96f1d7c9244d8f9bb12912ba Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 22 Sep 2005 13:20:28 +0000 Subject: r10424: for caller convenience, automatically turn a tdb_traverse() into a tdb_traverse_read() for read only databases (This used to be commit 9b53e04377d2ff652c4a9496798d2e3aa0dccab3) --- source4/lib/tdb/common/traverse.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source4/lib/tdb') diff --git a/source4/lib/tdb/common/traverse.c b/source4/lib/tdb/common/traverse.c index 335dce4152..f8315f5770 100644 --- a/source4/lib/tdb/common/traverse.c +++ b/source4/lib/tdb/common/traverse.c @@ -220,6 +220,10 @@ int tdb_traverse(struct tdb_context *tdb, { struct tdb_traverse_lock tl = { NULL, 0, 0, F_WRLCK }; int ret; + + if (tdb->read_only) { + return tdb_traverse_read(tdb, fn, private); + } if (tdb->methods->tdb_brlock(tdb, TRANSACTION_LOCK, F_WRLCK, F_SETLKW, 0) == -1) { TDB_LOG((tdb, 0, "tdb_traverse: failed to get transaction lock\n")); -- cgit