X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ftdb2%2Ftransaction.c;h=d05b1fefd58bc9bea611d480ae2a40b2c992bf60;hp=e7050bfe1ec96555ce6907d1a5c00e7441ca509a;hb=323a9473c0aef80b8e18ef0c53529c8dfc29ec45;hpb=1d4d21dfb5ac43274afc125f132d196ce07f3177 diff --git a/ccan/tdb2/transaction.c b/ccan/tdb2/transaction.c index e7050bfe..d05b1fef 100644 --- a/ccan/tdb2/transaction.c +++ b/ccan/tdb2/transaction.c @@ -642,8 +642,8 @@ static int tdb_recovery_allocate(struct tdb_context *tdb, 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; @@ -1108,8 +1108,8 @@ int tdb_transaction_recover(struct tdb_context *tdb) /* 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; @@ -1241,7 +1241,8 @@ bool tdb_needs_recovery(struct tdb_context *tdb) /* 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; }