summaryrefslogtreecommitdiff
path: root/lib/tdb/test/run-transaction-expand.c
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2012-02-14 14:45:21 +1030
committerRusty Russell <rusty@rustcorp.com.au>2012-02-14 14:45:21 +1030
commit205242e1769f96e0e8fccd52378965d35dd02093 (patch)
tree5bce8a0d01f0f6dd2360b93033934d27a93d9eef /lib/tdb/test/run-transaction-expand.c
parent8fa345d952328c5866f3a0f835f3599343c51b00 (diff)
downloadsamba-205242e1769f96e0e8fccd52378965d35dd02093.tar.gz
samba-205242e1769f96e0e8fccd52378965d35dd02093.tar.bz2
samba-205242e1769f96e0e8fccd52378965d35dd02093.zip
tdb/test: fix up tests for use in SAMBA tdb code.
1) Make sure we include "tdb_private.h" first, to get the right headers (esp. the correct setting of _FILE_OFFSET_BITS before unistd.h). 2) Fix 3G file test since expand logic has changed. 3) Fix nested transaction test, since default is to allow nesting. 4) Capture fdatasync, which was slowing down transaction expand. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'lib/tdb/test/run-transaction-expand.c')
-rw-r--r--lib/tdb/test/run-transaction-expand.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/tdb/test/run-transaction-expand.c b/lib/tdb/test/run-transaction-expand.c
index e43eec412b..3b79dbb6ea 100644
--- a/lib/tdb/test/run-transaction-expand.c
+++ b/lib/tdb/test/run-transaction-expand.c
@@ -1,6 +1,3 @@
-/* We need this otherwise fcntl locking fails. */
-#define _FILE_OFFSET_BITS 64
-#define _XOPEN_SOURCE 500
#include "../common/tdb_private.h"
/* Speed up the tests: setting TDB_NOSYNC removed recovery altogether. */
@@ -18,7 +15,14 @@ static inline int fake_msync(void *addr, size_t length, int flags)
#define msync fake_msync
#endif
-#include "../common/tdb_private.h"
+#ifdef HAVE_FDATASYNC
+static inline int fake_fdatasync(int fd)
+{
+ return 0;
+}
+#define fdatasync fake_fdatasync
+#endif
+
#include "../common/io.c"
#include "../common/tdb.c"
#include "../common/lock.c"