aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/signals.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libutil/signals.cc')
-rw-r--r--src/libutil/signals.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libutil/signals.cc b/src/libutil/signals.cc
index 4e9ed0ba1..dac2964ae 100644
--- a/src/libutil/signals.cc
+++ b/src/libutil/signals.cc
@@ -12,13 +12,18 @@ std::atomic<bool> _isInterrupted = false;
thread_local std::function<bool()> interruptCheck;
+Interrupted makeInterrupted()
+{
+ return Interrupted("interrupted by the user");
+}
+
void _interrupted()
{
/* Block user interrupts while an exception is being handled.
Throwing an exception while another exception is being handled
kills the program! */
if (!std::uncaught_exceptions()) {
- throw Interrupted("interrupted by the user");
+ throw makeInterrupted();
}
}