aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Middendorf <middendorf@plapadoo.de>2020-04-09 17:05:29 +0200
committerPhilipp Middendorf <middendorf@plapadoo.de>2020-04-09 17:05:29 +0200
commit04bedda0b605dcecacb23b65d5a05c8f4aecfbdd (patch)
treede09f040cb53986fa61a74a90aa6b754d7ce3f6a
parent30d4618cc944a41c2ca202babd0be0da4a1cd9d2 (diff)
gc.cc: Ignore hidden files in temproots
-rw-r--r--src/libstore/gc.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libstore/gc.cc b/src/libstore/gc.cc
index 0c3d89611..6bab1e37c 100644
--- a/src/libstore/gc.cc
+++ b/src/libstore/gc.cc
@@ -202,6 +202,11 @@ void LocalStore::findTempRoots(FDs & fds, Roots & tempRoots, bool censor)
/* Read the `temproots' directory for per-process temporary root
files. */
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;
pid_t pid = std::stoi(i.name);