1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-28 17:51:15 +02:00

* Don't delete active lock files.

This commit is contained in:
Eelco Dolstra 2005-01-31 12:19:53 +00:00
parent 1328aa3307
commit 33c5d23b81
5 changed files with 39 additions and 9 deletions

View file

@ -127,9 +127,8 @@ PathLocks::~PathLocks()
/* Write a (meaningless) token to the file to indicate to
other processes waiting on this lock that the lock is
stale (deleted). */
if (write(i->first, "d", 1) == 1) {
unlink(i->second.c_str());
}
unlink(i->second.c_str());
writeFull(i->first, (const unsigned char *) "d", 1);
/* Note that the result of unlink() is ignored; removing
the lock file is an optimisation, not a necessity. */
}