Fix previous fix about locating lockfile in XDG_RUNTIME_DIR: would always compute the same lock name

This commit is contained in:
Jean-Francois Dockes 2020-07-21 10:47:10 +02:00
parent d48a0619b1
commit 610e3282c3

View File

@ -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");
}