posix: restore original SEGV signal handler upon first entry of our handler

The current SEGV handling on posix is not useful: as soon as our handler
is left, it's triggered again, infinitely.
This patch changes to restore the original handler, so the OS can create
a core dump, etc.
This commit is contained in:
Beat Küng 2019-05-29 07:43:06 +02:00 committed by Lorenz Meier
parent b334b75886
commit 6e2b70cbcd
1 changed files with 1 additions and 1 deletions

View File

@ -405,7 +405,7 @@ void register_sig_handler()
// SIGSEGV
struct sigaction sig_segv {};
sig_segv.sa_handler = sig_segv_handler;
sig_segv.sa_flags = SA_RESTART | SA_SIGINFO;
sig_segv.sa_flags = SA_RESTART | SA_SIGINFO | SA_RESETHAND;
#ifdef __PX4_CYGWIN
// Do not catch SIGINT on Cygwin such that the process gets killed