diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/libstore/pathlocks.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/libstore/pathlocks.cc b/src/libstore/pathlocks.cc index c057edce11..321e965bb3 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); } } |