From 77ad443bd1a7f96271688efdcd9021a1cba64a46 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 4 Jan 2016 11:32:46 +0100 Subject: ~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(-) (limited to 'src/libstore/pathlocks.cc') 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(); + } } -- cgit 1.4.1