From: Vladimír Čunát Date: Wed, 19 May 2021 12:07:08 +0000 (+0200) Subject: WIP: all seems to work now, on a quick test at least X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ae426ef393962d33f23f7521e7ea313ade9688e1;p=thirdparty%2Fknot-resolver.git WIP: all seems to work now, on a quick test at least Well, side stuff like tests might not work. --- diff --git a/lib/cache/cdb_lmdb.c b/lib/cache/cdb_lmdb.c index ca98878fe..ad59ba05f 100644 --- a/lib/cache/cdb_lmdb.c +++ b/lib/cache/cdb_lmdb.c @@ -25,6 +25,8 @@ #define LMDB_DIR_MODE 0770 #define LMDB_FILE_MODE 0660 +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" //TODO later, maybe + /* TODO: we rely on mirrors of these two structs not changing layout * in libknot and knot resolver! */ @@ -80,6 +82,10 @@ static int cdb_commit(kr_cdb_pt db, struct kr_cdb_stats *stats); static int lmdb_error(int error) { switch (error) { +#if KR_USE_MDBX + // not interested in differentiating this one, for now at least + case MDBX_RESULT_TRUE: +#endif case MDB_SUCCESS: return kr_ok(); case MDB_NOTFOUND: diff --git a/utils/cache_gc/db.c b/utils/cache_gc/db.c index bf7c3f0f2..d9aa4789d 100644 --- a/utils/cache_gc/db.c +++ b/utils/cache_gc/db.c @@ -3,6 +3,7 @@ #include "db.h" #include "lib/cache/cdb_lmdb.h" +#include "lib/cache/cdb_compat.h" #include "lib/cache/impl.h" #include @@ -13,7 +14,7 @@ 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); + snprintf(cache_data, sizeof(cache_data), "%s" MDB_DATANAME, cache_path); struct stat st = { 0 }; if (stat(cache_path, &st) || !(st.st_mode & S_IFDIR) diff --git a/utils/cache_gc/meson.build b/utils/cache_gc/meson.build index 02ab6c639..94bca5e2b 100644 --- a/utils/cache_gc/meson.build +++ b/utils/cache_gc/meson.build @@ -19,6 +19,7 @@ if build_utils libkres_dep, libknot, luajit_inc, + cache_backend_dep, ], install: true, install_dir: get_option('sbindir'),