diff options
Diffstat (limited to 'src/libstore/pathlocks.cc')
-rw-r--r-- | src/libstore/pathlocks.cc | 5 |
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. */ } |