X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Ftdb2%2Ftest%2Frun-57-die-during-transaction.c;h=e622395537afb8b85429fd7894ea5bb5021389d3;hb=a391b2b900bc6d5c0467869a454bdb5c51b5a3be;hp=b6c3557ad5eea8934afb208f5d3096cbc2850405;hpb=e5bb37eaf32db72f6f17eb01b8de5404fc3ce21c;p=ccan diff --git a/ccan/tdb2/test/run-57-die-during-transaction.c b/ccan/tdb2/test/run-57-die-during-transaction.c index b6c3557a..e6223955 100644 --- a/ccan/tdb2/test/run-57-die-during-transaction.c +++ b/ccan/tdb2/test/run-57-die-during-transaction.c @@ -1,4 +1,4 @@ -#include "config.h" +#include #include #include "lock-tracking.h" #include @@ -58,13 +58,8 @@ static void free_all(void) #define malloc malloc_noleak #define free free_noleak -#include -#include -#include -#include -#include -#include -#include +#include "tdb2-source.h" + #undef malloc #undef free #undef write @@ -152,7 +147,7 @@ reset: if (setjmp(jmpbuf) != 0) { /* We're partway through. Simulate our death. */ - close(tdb->fd); + close(tdb->file->fd); forget_locking(); in_transaction = false; @@ -207,8 +202,7 @@ reset: } /* Put key for agent to fetch. */ - key.dsize = strlen(KEY_STRING); - key.dptr = (void *)KEY_STRING; + key = tdb_mkdata(KEY_STRING, strlen(KEY_STRING)); if (tdb_store(tdb, key, key, TDB_INSERT) != 0) return false;