]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
WIP: all seems to work now, on a quick test at least
authorVladimír Čunát <vladimir.cunat@nic.cz>
Wed, 19 May 2021 12:07:08 +0000 (14:07 +0200)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Wed, 19 May 2021 12:10:07 +0000 (14:10 +0200)
Well, side stuff like tests might not work.

lib/cache/cdb_lmdb.c
utils/cache_gc/db.c
utils/cache_gc/meson.build

index ca98878feb60a14d9b9d81e0c73e0cea41edd495..ad59ba05f07c26452c857bcdc3e75de02c62ffd4 100644 (file)
@@ -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:
index bf7c3f0f2e351c8bbc47b65902c21433c9ee4a8a..d9aa4789d1ba0376129b904f27614964fcb22816 100644 (file)
@@ -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 <ctype.h>
@@ -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)
index 02ab6c639399017d6150a6a772d35f15721c1aed..94bca5e2bd720409ef06220120f08d34144a68a5 100644 (file)
@@ -19,6 +19,7 @@ if build_utils
       libkres_dep,
       libknot,
       luajit_inc,
+      cache_backend_dep,
     ],
     install: true,
     install_dir: get_option('sbindir'),