File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -81,12 +81,17 @@ static void exit_with_default_sighandler(const SignalType fatal_signal_id) {
8181 << std::flush;
8282 }
8383
84- // ::kill(::getpid(), fatal_signal_id);
85- if (fatal_signal_id == SIGABRT) {
86- std::_Exit (fatal_signal_id);
87- } else {
88- std::exit (fatal_signal_id);
84+ // Use std::raise to send the signal to the current process
85+ if (std::raise (fatal_signal_id) != 0 ) {
86+ std::cerr << " \n "
87+ << __FUNCTION__ << " :" << __LINE__
88+ << " . Failed to raise signal, trying kill() "
89+ << fatal_signal_id << " \n\n "
90+ << std::flush;
8991 }
92+
93+ // Fallback in case std::raise doesn't terminate the process
94+ ::kill (::getpid(), fatal_signal_id);
9095}
9196
9297/* * \return signal_name Ref: signum.hpp and \ref installSignalHandler
You can’t perform that action at this time.
0 commit comments