- if (methods->twrite(tdb, tdb->transaction->magic_offset,
- &invalid, sizeof(invalid)) == -1 ||
- transaction_sync(tdb, tdb->transaction->magic_offset,
- sizeof(invalid)) == -1) {
- tdb_logerr(tdb, tdb->ecode, TDB_LOG_ERROR,
+ ecode = methods->twrite(tdb, tdb->transaction->magic_offset,
+ &invalid, sizeof(invalid));
+ if (ecode == TDB_SUCCESS)
+ ecode = transaction_sync(tdb,
+ tdb->transaction->magic_offset,
+ sizeof(invalid));
+ if (ecode != TDB_SUCCESS) {
+ tdb_logerr(tdb, ecode, TDB_LOG_ERROR,