Commit 51f592df authored by Rusty Russell's avatar Rusty Russell

tdb2: fix internal tdb_write_convert() error handling in tdb_open()

As noted, failtest was taking a long time, because a failure injected here
was not detected.
parent baa17ee2
...@@ -550,10 +550,11 @@ struct tdb_context *tdb_open(const char *name, int tdb_flags, ...@@ -550,10 +550,11 @@ struct tdb_context *tdb_open(const char *name, int tdb_flags,
/* Clear any features we don't understand. */ /* Clear any features we don't understand. */
if ((open_flags & O_ACCMODE) != O_RDONLY) { if ((open_flags & O_ACCMODE) != O_RDONLY) {
hdr.features_used &= TDB_FEATURE_MASK; hdr.features_used &= TDB_FEATURE_MASK;
if (tdb_write_convert(tdb, offsetof(struct tdb_header, ecode = tdb_write_convert(tdb, offsetof(struct tdb_header,
features_used), features_used),
&hdr.features_used, &hdr.features_used,
sizeof(hdr.features_used)) == -1) sizeof(hdr.features_used));
if (ecode != TDB_SUCCESS)
goto fail; goto fail;
} }
......
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