catch3
Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.
Clonegit clone https://git.progmasoft.com/catch3
If we receive a signal, we re-register ALL previous signal handlers.
- Commit
ffc4a9dc143bc66d2e1fd883e1395a3397a68e9d- Author
- Martin Hořeňovský ·
- Parents
7c8b93eac3e6
Changes
include/internal/catch_fatal_condition.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/internal/catch_fatal_condition.hpp b/include/internal/catch_fatal_condition.hpp index 895b662d..f99c8f26 100644 --- a/include/internal/catch_fatal_condition.hpp +++ b/include/internal/catch_fatal_condition.hpp @@ -118,10 +118,10 @@ namespace Catch { SignalDefs &def = signalDefs[i]; if (sig == def.id) { name = def.name; - sigaction(def.id, &oldSigActions[i], CATCH_NULL); break; } } + reset(); reportFatal(name, -sig); raise( sig ); } @@ -146,7 +146,7 @@ namespace Catch { ~FatalConditionHandler() { reset(); } - void reset() { + static void reset() { if( isSet ) { // Set signals back to previous values -- hopefully nobody overwrote them in the meantime for( std::size_t i = 0; i < sizeof(signalDefs)/sizeof(SignalDefs); ++i ) {