mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 05:18:07 -05:00
Revert "nix: Guard against removing temporary roots of living processes."
This reverts commit bb0beaecde
. This
change broke a number of tests that assumed the previous behavior.
This commit is contained in:
parent
094b357783
commit
eec920ba93
1 changed files with 4 additions and 5 deletions
|
@ -2,7 +2,6 @@
|
||||||
#include "misc.hh"
|
#include "misc.hh"
|
||||||
#include "local-store.hh"
|
#include "local-store.hh"
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <queue>
|
#include <queue>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
@ -227,10 +226,10 @@ static void readTempRoots(PathSet & tempRoots, FDs & fds)
|
||||||
//FDPtr fd(new AutoCloseFD(openLockFile(path, false)));
|
//FDPtr fd(new AutoCloseFD(openLockFile(path, false)));
|
||||||
//if (*fd == -1) continue;
|
//if (*fd == -1) continue;
|
||||||
|
|
||||||
/* Try to acquire a write lock without blocking. This can only
|
/* Try to acquire a write lock without blocking. This can
|
||||||
succeed if the owning process has died, in which case we don't care
|
only succeed if the owning process has died. In that case
|
||||||
about its temporary roots, or if we are the owning process. */
|
we don't care about its temporary roots. */
|
||||||
if (i.name != std::to_string(getpid()) && lockFile(*fd, ltWrite, false)) {
|
if (lockFile(*fd, ltWrite, false)) {
|
||||||
printMsg(lvlError, format("removing stale temporary roots file `%1%'") % path);
|
printMsg(lvlError, format("removing stale temporary roots file `%1%'") % path);
|
||||||
unlink(path.c_str());
|
unlink(path.c_str());
|
||||||
writeFull(*fd, "d");
|
writeFull(*fd, "d");
|
||||||
|
|
Loading…
Reference in a new issue