about summary refs log tree commit diff
path: root/src/libstore/pathlocks.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstore/pathlocks.cc')
-rw-r--r--src/libstore/pathlocks.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/libstore/pathlocks.cc b/src/libstore/pathlocks.cc
index c057edce118b..321e965bb34b 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);
     }
 }