From: Petr Špaček Date: Fri, 9 Oct 2020 09:31:55 +0000 (+0200) Subject: lib/cache: rename lock file to krcachelock so it shows up in regular ls X-Git-Tag: v5.2.0~18^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b49ecbc3585eeaedc5620ddab55514af7f8b7793;p=thirdparty%2Fknot-resolver.git lib/cache: rename lock file to krcachelock so it shows up in regular ls --- diff --git a/lib/cache/cdb_lmdb.c b/lib/cache/cdb_lmdb.c index aef930312..5f4db061c 100644 --- a/lib/cache/cdb_lmdb.c +++ b/lib/cache/cdb_lmdb.c @@ -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; diff --git a/lib/cache/entry_list.c b/lib/cache/entry_list.c index 7110135bc..f2d9d0582 100644 --- a/lib/cache/entry_list.c +++ b/lib/cache/entry_list.c @@ -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); } }