- add_stat(tdb, frees, 1);
- if (add_free_record(tdb, recovery_head,
- sizeof(rec) + rec.max_len) != 0) {
- tdb_logerr(tdb, tdb->ecode, TDB_LOG_ERROR,
- "tdb_recovery_allocate:"
- " failed to free previous recovery area");
- return -1;
+ tdb->stats.frees++;
+ ecode = add_free_record(tdb, recovery_head,
+ sizeof(rec) + rec.max_len,
+ TDB_LOCK_WAIT, true);
+ if (ecode != TDB_SUCCESS) {
+ return tdb_logerr(tdb, ecode, TDB_LOG_ERROR,
+ "tdb_recovery_allocate:"
+ " failed to free previous"
+ " recovery area");