forked from lix-project/lix
getDefaultNixPath: ignore EPERM
This commit is contained in:
parent
b7cde90c6b
commit
a6c78ba367
|
@ -2620,12 +2620,17 @@ Strings EvalSettings::getDefaultNixPath()
|
||||||
{
|
{
|
||||||
Strings res;
|
Strings res;
|
||||||
auto add = [&](const Path & p, const std::string & s = std::string()) {
|
auto add = [&](const Path & p, const std::string & s = std::string()) {
|
||||||
if (pathExists(p)) {
|
try {
|
||||||
if (s.empty()) {
|
if (pathExists(p)) {
|
||||||
res.push_back(p);
|
if (s.empty()) {
|
||||||
} else {
|
res.push_back(p);
|
||||||
res.push_back(s + "=" + p);
|
} else {
|
||||||
|
res.push_back(s + "=" + p);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} catch (SysError & e) {
|
||||||
|
// swallow EPERM
|
||||||
|
if (e.errNo != EPERM) throw;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue