tdb: fix locking error
[samba.git] / lib / tdb / common / lock.c
index d812fbfdc5e6e3e03775314fe01e517627a78830..2c72ae1f0de1c5097afe8f54d27a04d7816e432a 100644 (file)
@@ -328,7 +328,7 @@ int tdb_transaction_unlock(struct tdb_context *tdb)
        if (tdb->global_lock.count) {
                return 0;
        }
        if (tdb->global_lock.count) {
                return 0;
        }
-       if (tdb->transaction_lock_count > 0) {
+       if (tdb->transaction_lock_count > 1) {
                tdb->transaction_lock_count--;
                return 0;
        }
                tdb->transaction_lock_count--;
                return 0;
        }