#include <ccan/tdb/error.c>
#include <ccan/tdb/open.c>
#include <ccan/tdb/check.c>
+#include <ccan/tdb/hash.c>
#include <ccan/tap/tap.h>
#include <stdlib.h>
#include <stdbool.h>
#include <stdarg.h>
#include <err.h>
#include "external-agent.h"
+#include "logging.h"
static struct agent *agent;
static bool opened;
#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;
int main(int argc, char *argv[])
{
- struct tdb_logging_context logctx = { taplog, NULL };
const int flags[] = { TDB_DEFAULT,
TDB_CLEAR_IF_FIRST,
TDB_NOMMAP,
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;