Added stack trace on signal.

(cherry picked from commit cf49e4bfa8)
This commit is contained in:
akallabeth 2020-11-10 10:11:03 +01:00 committed by akallabeth
parent 2704397db7
commit c54c846b59

View File

@ -43,6 +43,7 @@ int freerdp_handle_signals(void)
#else
#include <pthread.h>
#include <winpr/debug.h>
volatile sig_atomic_t terminal_needs_reset = 0;
int terminal_fildes = 0;
@ -53,8 +54,15 @@ static void fatal_handler(int signum)
{
struct sigaction default_sigaction;
sigset_t this_mask;
WLog_INFO(TAG, "Caught signal '%s' [%d]", strsignal(signum), signum);
static BOOL recursive = FALSE;
if (!recursive)
{
recursive = TRUE;
WLog_ERR(TAG, "Caught signal '%s' [%d]", strsignal(signum), signum);
winpr_log_backtrace(TAG, WLOG_ERROR, 20);
}
if (terminal_needs_reset)
tcsetattr(terminal_fildes, TCSAFLUSH, &orig_flags);