From 610e3282c3ab6504220bbfc51d3422bc5b349f34 Mon Sep 17 00:00:00 2001 From: Jean-Francois Dockes Date: Tue, 21 Jul 2020 10:47:10 +0200 Subject: [PATCH] Fix previous fix about locating lockfile in XDG_RUNTIME_DIR: would always compute the same lock name --- src/common/rclconfig.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/common/rclconfig.cpp b/src/common/rclconfig.cpp index 336f73c7..f95cfa44 100644 --- a/src/common/rclconfig.cpp +++ b/src/common/rclconfig.cpp @@ -1396,11 +1396,12 @@ string RclConfig::getPidfile() const { const char *p = getenv("XDG_RUNTIME_DIR"); if (p) { - string base = path_canon(p); - string digest; - return path_cat( - base, "/recoll-" + MD5HexPrint(getConfDir(), digest) + "-index.pid"); - } + string base = path_canon(p); + string digest, hex; + MD5String(getConfDir(), digest); + MD5HexPrint(digest, hex); + return path_cat(base, "/recoll-" + hex + "-index.pid"); + } return path_cat(getCacheDir(), "index.pid"); }