summaryrefslogtreecommitdiffstats
path: root/utils/cache_gc/db.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-05 04:15:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-05 04:15:14 +0000
commit3a88b081ec27c1aafdb3d20c8054d346a0fe12ad (patch)
tree0c5420a148abb96557d657cedd70005ff1e3ff21 /utils/cache_gc/db.c
parentReleasing progress-linux version 5.7.2-1~progress7.99u1. (diff)
downloadknot-resolver-3a88b081ec27c1aafdb3d20c8054d346a0fe12ad.tar.xz
knot-resolver-3a88b081ec27c1aafdb3d20c8054d346a0fe12ad.zip
Merging upstream version 5.7.3.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'utils/cache_gc/db.c')
-rw-r--r--utils/cache_gc/db.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/utils/cache_gc/db.c b/utils/cache_gc/db.c
index fc4a2fd..c31ff22 100644
--- a/utils/cache_gc/db.c
+++ b/utils/cache_gc/db.c
@@ -9,11 +9,13 @@
#include <time.h>
#include <sys/stat.h>
+#define MDB_FILE "/data.mdb"
+
int kr_gc_cache_open(const char *cache_path, struct kr_cache *kres_db,
knot_db_t ** libknot_db)
{
- char cache_data[strlen(cache_path) + 10];
- snprintf(cache_data, sizeof(cache_data), "%s/data.mdb", cache_path);
+ char cache_data[strlen(cache_path) + sizeof(MDB_FILE)];
+ (void)snprintf(cache_data, sizeof(cache_data), "%s" MDB_FILE, cache_path);
struct stat st = { 0 };
if (stat(cache_path, &st) || !(st.st_mode & S_IFDIR)