X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Ftdb2%2Ftest%2Frun-57-die-during-transaction.c;h=84f01eb21a8dd009d5a6d738485f96e790822a55;hb=156e5eb92f1d986957cb081b58320579c6e366dd;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..84f01eb2 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 "config.h" #include #include "lock-tracking.h" #include @@ -59,6 +59,7 @@ static void free_all(void) #define free free_noleak #include +#include #include #include #include @@ -152,7 +153,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 +208,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;