aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/gc.cc
diff options
context:
space:
mode:
authorAndrew Brooks <andrew.brooks@flightaware.com>2022-09-12 11:33:23 -0500
committerAndrew Brooks <andrew.brooks@flightaware.com>2022-09-12 11:33:23 -0500
commit565d888e0f6a2c66ee7b10f6fe6a97f79fa51732 (patch)
tree76a77d5552e398d658ded857b36ff8a656ac63e3 /src/libstore/gc.cc
parent84fe75a12a085c6b4b8d4ac65a048f569de1252b (diff)
Address PR feedback on #6694
Diffstat (limited to 'src/libstore/gc.cc')
-rw-r--r--src/libstore/gc.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/libstore/gc.cc b/src/libstore/gc.cc
index 6cd7efbc9..9ef8972f3 100644
--- a/src/libstore/gc.cc
+++ b/src/libstore/gc.cc
@@ -622,9 +622,8 @@ void LocalStore::collectGarbage(const GCOptions & options, GCResults & results)
/* There may be temp directories in the store that are still in use
by another process. We need to be sure that we can acquire an
exclusive lock before deleting them. */
- AutoCloseFD tmpDirFd;
- if (baseName.rfind("add-", 0) == 0) {
- tmpDirFd = open(realPath.c_str(), O_RDONLY | O_DIRECTORY);
+ if (baseName.find("tmp-", 0) == 0) {
+ AutoCloseFD tmpDirFd = open(realPath.c_str(), O_RDONLY | O_DIRECTORY);
if (tmpDirFd.get() == -1 || !lockFile(tmpDirFd.get(), ltWrite, false)) {
debug("skipping locked tempdir '%s'", realPath);
return;