X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Ftdb2%2Ftest%2Frun-57-die-during-transaction.c;h=e622395537afb8b85429fd7894ea5bb5021389d3;hb=ef92843f2c74ab9d4fa7f167a2182e5e8955df91;hp=f9b0426ea02f237bdcc46d4afc5fb3937ccf419f;hpb=b21004624683be5bf1d8f75e3b5be4e9618049ee;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 f9b0426e..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 @@ -#define _XOPEN_SOURCE 500 +#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;