summaryrefslogtreecommitdiff
path: root/nix
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2022-10-25 21:50:59 +0300
committerEfraim Flashner <efraim@flashner.co.il>2022-10-25 21:50:59 +0300
commit6ff203663e696b74e711ab09d6f4b35c2c332f0f (patch)
tree4bf2c77c62fa60febba527a76b1ecffaa0a00a0d /nix
parent408a4ed071c9c52de207d799a698781d49fa727d (diff)
parenta0751e3250dfea7e52468c8090e18c3118d93a60 (diff)
Merge remote-tracking branch 'origin/master' into staging
Diffstat (limited to 'nix')
-rw-r--r--nix/libstore/gc.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/nix/libstore/gc.cc b/nix/libstore/gc.cc
index f101de92d6..16519116e4 100644
--- a/nix/libstore/gc.cc
+++ b/nix/libstore/gc.cc
@@ -2,7 +2,6 @@
#include "misc.hh"
#include "local-store.hh"
-#include <string>
#include <functional>
#include <queue>
#include <algorithm>
@@ -227,10 +226,10 @@ static void readTempRoots(PathSet & tempRoots, FDs & fds)
//FDPtr fd(new AutoCloseFD(openLockFile(path, false)));
//if (*fd == -1) continue;
- /* Try to acquire a write lock without blocking. This can only
- succeed if the owning process has died, in which case we don't care
- about its temporary roots, or if we are the owning process. */
- if (i.name != std::to_string(getpid()) && lockFile(*fd, ltWrite, false)) {
+ /* Try to acquire a write lock without blocking. This can
+ only succeed if the owning process has died. In that case
+ we don't care about its temporary roots. */
+ if (lockFile(*fd, ltWrite, false)) {
printMsg(lvlError, format("removing stale temporary roots file `%1%'") % path);
unlink(path.c_str());
writeFull(*fd, "d");