From 528f1d1867de8b653eed516f8448096d7d138978 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sun, 21 Dec 2003 17:09:16 +0000 Subject: [PATCH] * Bug fix: parallel builds of the same derivation failed due to lock file removal. --- src/libstore/pathlocks.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/libstore/pathlocks.cc b/src/libstore/pathlocks.cc index c057edce1..321e965bb 100644 --- a/src/libstore/pathlocks.cc +++ b/src/libstore/pathlocks.cc @@ -87,10 +87,12 @@ PathLocks::~PathLocks() close(*i); for (Paths::iterator i = paths.begin(); i != paths.end(); i++) { - if (deletePaths) + if (deletePaths) { /* This is not safe in general! */ - if (unlink(i->c_str()) != 0) - throw SysError(format("removing lock file `%1%'") % *i); + unlink(i->c_str()); + /* Note that the result of unlink() is ignored; removing + the lock file is an optimisation, not a necessity. */ + } lockedPaths.erase(*i); } }