enum TDB_ERROR ecode;
recovery_head = tdb_read_off(tdb, offsetof(struct tdb_header,recovery));
- if (recovery_head == TDB_OFF_ERR) {
- tdb_logerr(tdb, tdb->ecode, TDB_LOG_ERROR,
+ if (TDB_OFF_IS_ERR(recovery_head)) {
+ tdb_logerr(tdb, recovery_head, TDB_LOG_ERROR,
"tdb_recovery_allocate:"
" failed to read recovery head");
return -1;
the transaction) */
if (recovery_head != 0) {
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,
+ ecode = add_free_record(tdb, recovery_head,
+ sizeof(rec) + rec.max_len);
+ if (ecode != TDB_SUCCESS) {
+ tdb_logerr(tdb, ecode, TDB_LOG_ERROR,
"tdb_recovery_allocate:"
" failed to free previous recovery area");
return -1;
/* find the recovery area */
recovery_head = tdb_read_off(tdb, offsetof(struct tdb_header,recovery));
- if (recovery_head == TDB_OFF_ERR) {
- tdb_logerr(tdb, tdb->ecode, TDB_LOG_ERROR,
+ if (TDB_OFF_IS_ERR(recovery_head)) {
+ tdb_logerr(tdb, recovery_head, TDB_LOG_ERROR,
"tdb_transaction_recover:"
" failed to read recovery head");
return -1;
/* find the recovery area */
recovery_head = tdb_read_off(tdb, offsetof(struct tdb_header,recovery));
- if (recovery_head == TDB_OFF_ERR) {
+ if (TDB_OFF_IS_ERR(recovery_head)) {
+ tdb->ecode = recovery_head;
return true;
}