]> git.ozlabs.org Git - ccan/blobdiff - ccan/tdb2/test/run-57-die-during-transaction.c
tdb2: Fix to always use 64-bit offset definition
[ccan] / ccan / tdb2 / test / run-57-die-during-transaction.c
index 59b4d62c1c002403a3086a6c959a486fd4ea37a8..1b02802359ec5109fa69cca4170f88d2efcde47f 100644 (file)
@@ -1,4 +1,4 @@
-#include "config.h"
+#include <ccan/tdb2/private.h>
 #include <unistd.h>
 #include "lock-tracking.h"
 #include <ccan/tap/tap.h>
@@ -153,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;
 
@@ -208,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;