Browse Source

tdb2: don't return -1 (ie. TDB_ERR_CORRUPT) on transaction write fail.

A left-over -1 return; should be returning ecode (probably TDB_ERR_IO).
Rusty Russell 14 years ago
parent
commit
077bdae687
1 changed files with 1 additions and 1 deletions
  1. 1 1
      ccan/tdb2/transaction.c

+ 1 - 1
ccan/tdb2/transaction.c

@@ -203,7 +203,7 @@ static enum TDB_ERROR transaction_write(struct tdb_context *tdb, tdb_off_t off,
 		tdb_len_t len2 = PAGESIZE - (off % PAGESIZE);
 		ecode = transaction_write(tdb, off, buf, len2);
 		if (ecode != TDB_SUCCESS) {
-			return -1;
+			return ecode;
 		}
 		len -= len2;
 		off += len2;