guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/09: daemon: ~PathLocks(): Handle exceptions.


From: Ludovic Courtès
Subject: 02/09: daemon: ~PathLocks(): Handle exceptions.
Date: Tue, 31 May 2016 12:34:01 +0000 (UTC)

civodul pushed a commit to branch master
in repository guix.

commit 63a5be07e252904eeb83a88dce37008e1affec1a
Author: Eelco Dolstra <address@hidden>
Date:   Mon Jan 4 11:32:46 2016 +0100

    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 830858f..9797ddd 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();
+    }
 }
 
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]