1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00

r10424: for caller convenience, automatically turn a tdb_traverse() into a

tdb_traverse_read() for read only databases
(This used to be commit 9b53e04377)
This commit is contained in:
Andrew Tridgell 2005-09-22 13:20:28 +00:00 committed by Gerald (Jerry) Carter
parent fcb41c3bbd
commit 86df9ca15a

View File

@ -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"));