Commit 077bdae6 authored by Rusty Russell's avatar Rusty Russell

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).
parent 6d3832ee
...@@ -203,7 +203,7 @@ static enum TDB_ERROR transaction_write(struct tdb_context *tdb, tdb_off_t off, ...@@ -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); tdb_len_t len2 = PAGESIZE - (off % PAGESIZE);
ecode = transaction_write(tdb, off, buf, len2); ecode = transaction_write(tdb, off, buf, len2);
if (ecode != TDB_SUCCESS) { if (ecode != TDB_SUCCESS) {
return -1; return ecode;
} }
len -= len2; len -= len2;
off += len2; off += len2;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment