From 63a5be07e252904eeb83a88dce37008e1affec1a Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 4 Jan 2016 11:32:46 +0100 Subject: [PATCH] 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(). --- nix/libstore/pathlocks.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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(); + } }