From f619edda111f7ed73b61015cdf07bf684abb4b11 Mon Sep 17 00:00:00 2001
From: Jan Vcelak <jan.vcelak@nic.cz>
Date: Thu, 9 Oct 2014 20:41:49 +0200
Subject: [PATCH] persistent timers: place database files into storage/timers

---
 src/knot/zone/timers.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/knot/zone/timers.c b/src/knot/zone/timers.c
index 9492eb120..63c9ce1d1 100644
--- a/src/knot/zone/timers.c
+++ b/src/knot/zone/timers.c
@@ -15,6 +15,7 @@
  */
 
 #include "libknot/dname.h"
+#include "common/mem.h"
 #include "common/namedb/namedb.h"
 #include "common/namedb/namedb_lmdb.h"
 #include "knot/zone/timers.h"
@@ -125,7 +126,16 @@ knot_namedb_t *open_timers_db(const char *storage)
 	// No-op if we don't have lmdb, all other operations will no-op as well then
 	return NULL;
 #else
-	return namedb_lmdb_api()->init(storage, NULL);
+	char *path = sprintf_alloc("%s/timers", storage);
+	if (!path) {
+		return NULL;
+	}
+
+	knot_namedb_t *db = namedb_lmdb_api()->init(path, NULL);
+
+	free(path);
+
+	return db;
 #endif
 }
 
-- 
GitLab