about summary refs log tree commit diff
path: root/src/libstore/pathlocks.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2005-01-31T12·19+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2005-01-31T12·19+0000
commit33c5d23b814e16687808d5f2d79798fef7dc2a8a (patch)
treefe7f49222ff8f4e622cb6dfb5440ff22d888f186 /src/libstore/pathlocks.cc
parent1328aa33077fd1cf84869e366c82b8ea1d1abb5d (diff)
* Don't delete active lock files.
Diffstat (limited to 'src/libstore/pathlocks.cc')
-rw-r--r--src/libstore/pathlocks.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/libstore/pathlocks.cc b/src/libstore/pathlocks.cc
index a92b2225a51c..3beb49aac803 100644
--- a/src/libstore/pathlocks.cc
+++ b/src/libstore/pathlocks.cc
@@ -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. */
         }