svn commit: samba r10424 - in branches/SAMBA_4_0/source/lib/tdb/common: .

tridge at samba.org tridge at samba.org
Thu Sep 22 13:20:28 GMT 2005


Author: tridge
Date: 2005-09-22 13:20:28 +0000 (Thu, 22 Sep 2005)
New Revision: 10424

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=10424

Log:

for caller convenience, automatically turn a tdb_traverse() into a
tdb_traverse_read() for read only databases

Modified:
   branches/SAMBA_4_0/source/lib/tdb/common/traverse.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/tdb/common/traverse.c
===================================================================
--- branches/SAMBA_4_0/source/lib/tdb/common/traverse.c	2005-09-22 13:16:23 UTC (rev 10423)
+++ branches/SAMBA_4_0/source/lib/tdb/common/traverse.c	2005-09-22 13:20:28 UTC (rev 10424)
@@ -220,6 +220,10 @@
 {
 	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"));



More information about the samba-cvs mailing list