From 33c5d23b814e16687808d5f2d79798fef7dc2a8a Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 31 Jan 2005 12:19:53 +0000 Subject: * Don't delete active lock files. --- src/libstore/pathlocks.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/libstore/pathlocks.cc') 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. */ } -- cgit 1.4.1