]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
lib/cache: rename lock file to krcachelock so it shows up in regular ls
authorPetr Špaček <petr.spacek@nic.cz>
Fri, 9 Oct 2020 09:31:55 +0000 (11:31 +0200)
committerPetr Špaček <petr.spacek@nic.cz>
Fri, 9 Oct 2020 10:44:05 +0000 (12:44 +0200)
lib/cache/cdb_lmdb.c
lib/cache/entry_list.c

index aef9303125ec33d2d2c0de72fc18c3ce6ffc3560..5f4db061c5aed36161b533e31db64b3834f2baae 100644 (file)
@@ -560,7 +560,7 @@ static int cdb_clear(kr_cdb_pt db, struct kr_cdb_stats *stats)
                return lmdb_error(ret);
        }
        auto_free char *mdb_lockfile = kr_strcatdup(2, path, "/lock.mdb");
-       auto_free char *lockfile = kr_strcatdup(2, path, "/.cachelock");
+       auto_free char *lockfile = kr_strcatdup(2, path, "/krcachelock");
        if (!mdb_lockfile || !lockfile) {
                return kr_error(ENOMEM);
        }
@@ -568,7 +568,7 @@ static int cdb_clear(kr_cdb_pt db, struct kr_cdb_stats *stats)
        /* Find if we get a lock on lockfile. */
        const int lockfile_fd = lockfile_get(lockfile);
        if (lockfile_fd < 0) {
-               kr_log_error("[cache] clearing failed to get ./.cachelock (%s); retry later\n",
+               kr_log_error("[cache] clearing failed to get ./krcachelock (%s); retry later\n",
                                kr_strerror(lockfile_fd));
                /* As we're out of space (almost certainly - mdb_drop didn't work),
                 * we will retry on the next failing write operation. */
@@ -594,7 +594,7 @@ static int cdb_clear(kr_cdb_pt db, struct kr_cdb_stats *stats)
        /* Environment updated, release lockfile. */
        int lrerr = lockfile_release(lockfile_fd);
        if (lrerr) {
-               kr_log_error("[cache] failed to release ./.cachelock: %s\n",
+               kr_log_error("[cache] failed to release ./krcachelock: %s\n",
                                kr_strerror(lrerr));
        }
        return ret;
index 7110135bcfdaeda71fc50b1a3b226deb8fee654f..f2d9d05820cdf7f7ca9a21edc579ca4fcc33ad34 100644 (file)
@@ -184,7 +184,7 @@ static int cache_write_or_clear(struct kr_cache *cache, const knot_db_val_t *key
                abort();
        case 0:
                kr_log_info("[cache] overfull cache cleared\n");
-       case -EAGAIN: // fall-through; .cachelock race -> retry later
+       case -EAGAIN: // fall-through; krcachelock race -> retry later
                return kr_error(ENOSPC);
        }
 }