tdb2: allow multiple chain locks.
[ccan] / ccan / tdb2 / test / run-56-open-during-transaction.c
index 80a0b43c6c1c34d451bf6810b6386f3255313e77..96107d637e4472b7026b587f26c031191b1c9631 100644 (file)
@@ -1,4 +1,4 @@
-#define _XOPEN_SOURCE 500
+#include "config.h"
 #include <unistd.h>
 #include "lock-tracking.h"
 
@@ -12,6 +12,7 @@ static int ftruncate_check(int fd, off_t length);
 #define ftruncate ftruncate_check
 
 #include <ccan/tdb2/tdb.c>
+#include <ccan/tdb2/open.c>
 #include <ccan/tdb2/free.c>
 #include <ccan/tdb2/lock.c>
 #include <ccan/tdb2/io.c>
@@ -159,10 +160,8 @@ int main(int argc, char *argv[])
 
                opened = true;
                ok1(tdb_transaction_start(tdb) == 0);
-               key.dsize = strlen("hi");
-               key.dptr = (void *)"hi";
-               data.dptr = (void *)"world";
-               data.dsize = strlen("world");
+               key = tdb_mkdata("hi", strlen("hi"));
+               data = tdb_mkdata("world", strlen("world"));
 
                ok1(tdb_store(tdb, key, data, TDB_INSERT) == 0);
                ok1(tdb_transaction_commit(tdb) == 0);