aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr
diff options
context:
space:
mode:
authorRobert Hensing <robert@roberthensing.nl>2024-10-01 15:30:30 -0700
committerRebecca Turner <rbt@sent.as>2024-10-01 15:49:56 -0700
commitee0c195eba7d16b796fd9883e3fe88c0d64ff0bf (patch)
tree1048d5203ed5780274bbbd3992f986a5df6a1981 /src/libexpr
parent775292766025380d04004e42fefbdb8ca40b3fa3 (diff)
Split ignoreException to avoid suppressing CTRL-C
This splits `ignoreException` into `ignoreExceptionExceptInterrupt` (which ignores all exceptions except `Interrupt`, which indicates a SIGINT/CTRL-C) and `ignoreExceptionInDestructor` (which ignores all exceptions, so that destructors do not throw exceptions). This prevents many cases where Nix ignores CTRL-C entirely. See: https://github.com/NixOS/nix/issues/7245 Upstream-PR: https://github.com/NixOS/nix/pull/11618 Change-Id: Ie7d2467eedbe840d1b9fa2e88a4e88e4ab26a87b
Diffstat (limited to 'src/libexpr')
-rw-r--r--src/libexpr/eval-cache.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libexpr/eval-cache.cc b/src/libexpr/eval-cache.cc
index 83bfd4fb0..e7336c7e8 100644
--- a/src/libexpr/eval-cache.cc
+++ b/src/libexpr/eval-cache.cc
@@ -79,7 +79,7 @@ struct AttrDb
state->txn->commit();
state->txn.reset();
} catch (...) {
- ignoreException();
+ ignoreExceptionInDestructor();
}
}
@@ -90,7 +90,7 @@ struct AttrDb
try {
return fun();
} catch (SQLiteError &) {
- ignoreException();
+ ignoreExceptionExceptInterrupt();
failed = true;
return 0;
}
@@ -329,7 +329,7 @@ static std::shared_ptr<AttrDb> makeAttrDb(
try {
return std::make_shared<AttrDb>(cfg, fingerprint, symbols);
} catch (SQLiteError &) {
- ignoreException();
+ ignoreExceptionExceptInterrupt();
return nullptr;
}
}