tdb2: rework io functions to return enum TDB_ERROR.
[ccan] / ccan / tdb2 / free.c
index bface0a319fb94504059160ed9247db493e16e9f..83ad7ff5d60ac81deb55d564f09296b28ee5812a 100644 (file)
@@ -625,7 +625,9 @@ static int tdb_expand(struct tdb_context *tdb, tdb_len_t size)
                return 0;
        }
 
                return 0;
        }
 
-       if (tdb->methods->expand_file(tdb, wanted) == -1) {
+       ecode = tdb->methods->expand_file(tdb, wanted);
+       if (ecode != TDB_SUCCESS) {
+               tdb->ecode = ecode;
                tdb_unlock_expand(tdb, F_WRLCK);
                return -1;
        }
                tdb_unlock_expand(tdb, F_WRLCK);
                return -1;
        }