X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Ftdb2%2Ftest%2Frun-remap-in-read_traverse.c;h=85df6612a9d5277158de2ac7b91fc927ca265c01;hb=74b0109ebd2a30d57d19ae9a56f16c0f3b3637eb;hp=8dd1bf8330449dc20bc8d12f32c8cf282be6bc15;hpb=5e8b9af5e7fe5f1ccac407873a3b782b8a629782;p=ccan diff --git a/ccan/tdb2/test/run-remap-in-read_traverse.c b/ccan/tdb2/test/run-remap-in-read_traverse.c index 8dd1bf83..85df6612 100644 --- a/ccan/tdb2/test/run-remap-in-read_traverse.c +++ b/ccan/tdb2/test/run-remap-in-read_traverse.c @@ -1,6 +1,7 @@ /* We had a bug where we marked the tdb read-only for a tdb_traverse_read. * If we then expanded the tdb, we would remap read-only, and later SEGV. */ #include +#include #include #include #include @@ -50,13 +51,15 @@ int main(int argc, char *argv[]) O_RDWR|O_CREAT|O_TRUNC, 0600, &tap_log_attr); ok1(external_agent_operation(agent, OPEN, filename) == SUCCESS); - i = add_records_to_grow(agent, tdb->fd, tdb->map_size); + i = add_records_to_grow(agent, tdb->file->fd, tdb->file->map_size); - /* Do a read traverse. */ - ok1(tdb_traverse_read(tdb, NULL, NULL) == i); + /* Do a traverse. */ + ok1(tdb_traverse(tdb, NULL, NULL) == i); /* Now store something! */ ok1(tdb_store(tdb, d, d, TDB_INSERT) == 0); ok1(tap_log_messages == 0); + tdb_close(tdb); + free_external_agent(agent); return exit_status(); }