]> git.ozlabs.org Git - ccan/blobdiff - ccan/tdb2/tdb1_lock.c
tdb2: use tdb->flags & TDB_RDONLY instead of tdb->read_only for TDB1 code.
[ccan] / ccan / tdb2 / tdb1_lock.c
index 65fa1c123c5086b208448ee0dcb8487f1073d965..1b7ab7c7dc6776b0186c0ab56facd464cacc2c1f 100644 (file)
@@ -329,8 +329,8 @@ int tdb1_allrecord_lock(struct tdb1_context *tdb, int ltype,
 /* unlock entire db */
 int tdb1_allrecord_unlock(struct tdb1_context *tdb, int ltype)
 {
 /* unlock entire db */
 int tdb1_allrecord_unlock(struct tdb1_context *tdb, int ltype)
 {
-       /* There are no locks on read-only dbs */
-       if (tdb->read_only || tdb->traverse_read) {
+       /* Don't try this during r/o traversal! */
+       if (tdb->traverse_read) {
                tdb->last_error = TDB_ERR_LOCK;
                return -1;
        }
                tdb->last_error = TDB_ERR_LOCK;
                return -1;
        }