Browse Source

tdb2: fix error handling for tdb1_transaction_commit.

tdb_repack() returns an enum TDB_ERROR, whereas
tdb1_transaction_commit is expected to return 0 or -1.
Rusty Russell 14 years ago
parent
commit
b679512e42
1 changed files with 2 additions and 1 deletions
  1. 2 1
      ccan/tdb2/tdb1_transaction.c

+ 2 - 1
ccan/tdb2/tdb1_transaction.c

@@ -1174,7 +1174,8 @@ int tdb1_transaction_commit(struct tdb_context *tdb)
 	_tdb1_transaction_cancel(tdb);
 
 	if (need_repack) {
-		return tdb_repack(tdb);
+		if (tdb_repack(tdb) != 0)
+			return -1;
 	}
 
 	return 0;