X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ftdb%2Ftest%2Frun-open-during-transaction.c;fp=ccan%2Ftdb%2Ftest%2Frun-open-during-transaction.c;h=98cbac9173075c1059b2f143514c61a79a1bc636;hp=1c55b723413e12eccaaab4f017561799fa74b9b6;hb=655ef777da34bae1ec992503d754e607d6cebf8c;hpb=735980539f488d6f6299ec710f4045abbb104d46 diff --git a/ccan/tdb/test/run-open-during-transaction.c b/ccan/tdb/test/run-open-during-transaction.c index 1c55b723..98cbac91 100644 --- a/ccan/tdb/test/run-open-during-transaction.c +++ b/ccan/tdb/test/run-open-during-transaction.c @@ -27,6 +27,7 @@ static int ftruncate_check(int fd, off_t length); #include #include #include "external-agent.h" +#include "logging.h" static struct agent *agent; static bool opened; @@ -39,20 +40,6 @@ static bool clear_if_first; #undef fcntl #undef ftruncate -static void taplog(struct tdb_context *tdb, - enum tdb_debug_level level, - const char *fmt, ...) -{ - va_list ap; - char line[200]; - - va_start(ap, fmt); - vsprintf(line, fmt, ap); - va_end(ap); - - diag("%s", line); -} - static bool is_same(const char *snapshot, const char *latest, off_t len) { unsigned i; @@ -154,7 +141,6 @@ static int ftruncate_check(int fd, off_t length) int main(int argc, char *argv[]) { - struct tdb_logging_context logctx = { taplog, NULL }; const int flags[] = { TDB_DEFAULT, TDB_CLEAR_IF_FIRST, TDB_NOMMAP, @@ -177,7 +163,7 @@ int main(int argc, char *argv[]) unlink(TEST_DBNAME); tdb = tdb_open_ex(TEST_DBNAME, 1024, flags[i], O_CREAT|O_TRUNC|O_RDWR, 0600, - &logctx, NULL); + &taplogctx, NULL); ok1(tdb); opened = true;