From 77ad443bd1a7f96271688efdcd9021a1cba64a46 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 4 Jan 2016 11:32:46 +0100 Subject: [PATCH] ~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(). --- src/libstore/pathlocks.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/libstore/pathlocks.cc b/src/libstore/pathlocks.cc index 1c87034f8..eddf5bcbd 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(); + } }