gc.cc: Ignore hidden files in temproots

This commit is contained in:
Philipp Middendorf 2020-04-09 17:05:29 +02:00
parent 30d4618cc9
commit 04bedda0b6

View file

@ -202,6 +202,11 @@ void LocalStore::findTempRoots(FDs & fds, Roots & tempRoots, bool censor)
/* Read the `temproots' directory for per-process temporary root /* Read the `temproots' directory for per-process temporary root
files. */ files. */
for (auto & i : readDirectory(tempRootsDir)) { for (auto & i : readDirectory(tempRootsDir)) {
if (i.name[0] == '.') {
// Ignore hidden files. Some package managers (notably portage) create
// those to keep the directory alive.
continue;
}
Path path = tempRootsDir + "/" + i.name; Path path = tempRootsDir + "/" + i.name;
pid_t pid = std::stoi(i.name); pid_t pid = std::stoi(i.name);