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.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libstore/pathlocks.cc b/src/libstore/pathlocks.cc
index 620c9a6b752d..bf7ad3d21851 100644
--- a/src/libstore/pathlocks.cc
+++ b/src/libstore/pathlocks.cc
@@ -13,7 +13,7 @@
 namespace nix {
 
 
-int openLockFile(const Path & path, bool create)
+AutoCloseFD openLockFile(const Path & path, bool create)
 {
     AutoCloseFD fd;
 
@@ -21,7 +21,7 @@ int openLockFile(const Path & path, bool create)
     if (!fd && (create || errno != ENOENT))
         throw SysError(format("opening lock file ‘%1%’") % path);
 
-    return fd.release();
+    return fd;
 }
 
 
@@ -136,6 +136,7 @@ bool PathLocks::lockPaths(const PathSet & _paths,
                         /* Failed to lock this path; release all other
                            locks. */
                         unlock();
+                        lockedPaths_.lock()->erase(lockPath);
                         return false;
                     }
                 }