lockfile: only compute and log once
This commit is contained in:
parent
2c60e382f8
commit
310d28a4a1
@ -1398,7 +1398,8 @@ string RclConfig::getIdxStatusFile() const
|
|||||||
// Thanks to user Madhu for this fix.
|
// Thanks to user Madhu for this fix.
|
||||||
string RclConfig::getPidfile() const
|
string RclConfig::getPidfile() const
|
||||||
{
|
{
|
||||||
string fn;
|
static string fn;
|
||||||
|
if (fn.empty()) {
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
const char *p = getenv("XDG_RUNTIME_DIR");
|
const char *p = getenv("XDG_RUNTIME_DIR");
|
||||||
string rundir;
|
string rundir;
|
||||||
@ -1428,6 +1429,7 @@ string RclConfig::getPidfile() const
|
|||||||
fn = path_cat(getCacheDir(), "index.pid");
|
fn = path_cat(getCacheDir(), "index.pid");
|
||||||
out:
|
out:
|
||||||
LOGINF("RclConfig: pid/lock file: " << fn << "\n");
|
LOGINF("RclConfig: pid/lock file: " << fn << "\n");
|
||||||
|
}
|
||||||
return fn;
|
return fn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user