tdb: Improve debugging when the allrecord lock fails to upgrade
[amitay/samba.git] / lib / tdb / common / lock.c
index 4ad70cff3fe639abb781b204aa86a437e4a7adfe..e330201961a05bfef839659f260a5bbae078fbb5 100644 (file)
@@ -257,12 +257,14 @@ int tdb_allrecord_upgrade(struct tdb_context *tdb)
                TDB_LOG((tdb, TDB_DEBUG_ERROR,
                         "tdb_allrecord_upgrade failed: count %u too high\n",
                         tdb->allrecord_lock.count));
+               tdb->ecode = TDB_ERR_LOCK;
                return -1;
        }
 
        if (tdb->allrecord_lock.off != 1) {
                TDB_LOG((tdb, TDB_DEBUG_ERROR,
                         "tdb_allrecord_upgrade failed: already upgraded?\n"));
+               tdb->ecode = TDB_ERR_LOCK;
                return -1;
        }