summary refs log tree commit diff
path: root/nix
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2016-01-04 11:32:46 +0100
committerLudovic Courtès <ludo@gnu.org>2016-05-31 14:25:28 +0200
commit63a5be07e252904eeb83a88dce37008e1affec1a (patch)
treec8ada2537be124a5f22abd2e86ea4a3360867ed9 /nix
parente08380fb6cefd3fd67c3c220a3ddaf385e6413cf (diff)
downloadguix-63a5be07e252904eeb83a88dce37008e1affec1a.tar.gz
daemon: ~PathLocks(): Handle exceptions.
Otherwise, since the call to write a "d" character to the lock file
can fail with ENOSPC, we can get an unhandled exception resulting in a
call to terminate().
Diffstat (limited to 'nix')
-rw-r--r--nix/libstore/pathlocks.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/nix/libstore/pathlocks.cc b/nix/libstore/pathlocks.cc
index 830858ff8d..9797ddd7ab 100644
--- a/nix/libstore/pathlocks.cc
+++ b/nix/libstore/pathlocks.cc
@@ -162,7 +162,11 @@ bool PathLocks::lockPaths(const PathSet & _paths,
 
 PathLocks::~PathLocks()
 {
-    unlock();
+    try {
+        unlock();
+    } catch (...) {
+        ignoreException();
+    }
 }