diff options
Diffstat (limited to 'src/libutil')
-rw-r--r-- | src/libutil/signals.cc | 9 | ||||
-rw-r--r-- | src/libutil/signals.hh | 2 |
2 files changed, 1 insertions, 10 deletions
diff --git a/src/libutil/signals.cc b/src/libutil/signals.cc index f5c79b325..41fdc9dc8 100644 --- a/src/libutil/signals.cc +++ b/src/libutil/signals.cc @@ -9,21 +9,14 @@ namespace nix { std::atomic<bool> _isInterrupted = false; -static thread_local bool interruptThrown = false; thread_local std::function<bool()> interruptCheck; -void setInterruptThrown() -{ - interruptThrown = true; -} - void _interrupted() { /* Block user interrupts while an exception is being handled. Throwing an exception while another exception is being handled kills the program! */ - if (!interruptThrown && !std::uncaught_exceptions()) { - interruptThrown = true; + if (!std::uncaught_exceptions()) { throw Interrupted("interrupted by the user"); } } diff --git a/src/libutil/signals.hh b/src/libutil/signals.hh index c58dc37cf..71593df95 100644 --- a/src/libutil/signals.hh +++ b/src/libutil/signals.hh @@ -22,8 +22,6 @@ extern std::atomic<bool> _isInterrupted; extern thread_local std::function<bool()> interruptCheck; -void setInterruptThrown(); - void _interrupted(); void inline checkInterrupt() |