]> git.ozlabs.org Git - ccan/blobdiff - ccan/tdb2/tdb1_io.c
tdb2: make tests work in parallel.
[ccan] / ccan / tdb2 / tdb1_io.c
index 8219e93046e373f96e6812771ee5813bfe226ce0..f3d139d0434a97fc7c9dbb6a4deea6cb6d2cd43e 100644 (file)
@@ -307,6 +307,7 @@ static int tdb1_expand_file(struct tdb_context *tdb, tdb1_off_t size, tdb1_off_t
                addition -= written;
                size += written;
        }
+       tdb->stats.expands++;
        return 0;
 }
 
@@ -369,6 +370,9 @@ int tdb1_expand(struct tdb_context *tdb, tdb1_off_t size)
                char *new_map_ptr = (char *)realloc(tdb->file->map_ptr,
                                                    tdb->file->map_size);
                if (!new_map_ptr) {
+                       tdb->last_error = tdb_logerr(tdb, TDB_ERR_OOM,
+                                                    TDB_LOG_ERROR,
+                                                    "tdb1_expand: no memory");
                        tdb->file->map_size -= size;
                        goto fail;
                }