about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2016-01-04T10·32+0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2016-01-04T10·34+0100
commit77ad443bd1a7f96271688efdcd9021a1cba64a46 (patch)
tree2d4258d93bd5aa0cb7f09f65149ff9881ee39a8b /src
parentb8258a4475726b56a4caa6553568c67a343a091d (diff)
~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 'src')
-rw-r--r--src/libstore/pathlocks.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libstore/pathlocks.cc b/src/libstore/pathlocks.cc
index 1c87034f8e1a..eddf5bcbda65 100644
--- a/src/libstore/pathlocks.cc
+++ b/src/libstore/pathlocks.cc
@@ -161,7 +161,11 @@ bool PathLocks::lockPaths(const PathSet & _paths,
 
 PathLocks::~PathLocks()
 {
-    unlock();
+    try {
+        unlock();
+    } catch (...) {
+        ignoreException();
+    }
 }