summaryrefslogtreecommitdiff
path: root/source4/lib/tdb/tools/tdbtorture.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2004-08-27 15:52:54 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:58:24 -0500
commit826a515ec063cf7b986ddfcfd47f2f7f09a12be5 (patch)
tree058c7fec0890237e558936ddc96f252193fc3306 /source4/lib/tdb/tools/tdbtorture.c
parent3cd74a363402a88a78cc900fda1c03134a8e9945 (diff)
downloadsamba-826a515ec063cf7b986ddfcfd47f2f7f09a12be5.tar.gz
samba-826a515ec063cf7b986ddfcfd47f2f7f09a12be5.tar.bz2
samba-826a515ec063cf7b986ddfcfd47f2f7f09a12be5.zip
r2088: add tdbtorture tdbdump and tdbtest to the build
NOTE: tdbbackup and tdbtool seems to be broken... NOTE: I also added SMB_EXT_LIB(GDBM,...) because that is needed by tdbtest metze (This used to be commit e66630662d4203ccecbb20962e83dbf50a2c056f)
Diffstat (limited to 'source4/lib/tdb/tools/tdbtorture.c')
-rw-r--r--source4/lib/tdb/tools/tdbtorture.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/source4/lib/tdb/tools/tdbtorture.c b/source4/lib/tdb/tools/tdbtorture.c
index 3f704e537e..d7c0812800 100644
--- a/source4/lib/tdb/tools/tdbtorture.c
+++ b/source4/lib/tdb/tools/tdbtorture.c
@@ -1,3 +1,8 @@
+/* this tests tdb by doing lots of ops from several simultaneous
+ writers - that stresses the locking code. Build with TDB_DEBUG=1
+ for best effect */
+
+#ifdef STANDALONE
#include <stdlib.h>
#include <time.h>
#include <stdio.h>
@@ -13,11 +18,11 @@
#include <sys/wait.h>
#include "tdb.h"
-/* this tests tdb by doing lots of ops from several simultaneous
- writers - that stresses the locking code. Build with TDB_DEBUG=1
- for best effect */
+#else
+#include "includes.h"
+#endif
#define REOPEN_PROB 30
#define DELETE_PROB 8
@@ -32,6 +37,9 @@
static TDB_CONTEXT *db;
+#ifdef PRINTF_ATTRIBUTE
+static void tdb_log(TDB_CONTEXT *tdb, int level, const char *format, ...) PRINTF_ATTRIBUTE(3,4);
+#endif
static void tdb_log(TDB_CONTEXT *tdb, int level, const char *format, ...)
{
va_list ap;
@@ -50,7 +58,7 @@ static void tdb_log(TDB_CONTEXT *tdb, int level, const char *format, ...)
#endif
}
-static void fatal(char *why)
+static void fatal(const char *why)
{
perror(why);
exit(1);