From 154bfa6bdf703f0eea4beccfc71141771933d356 Mon Sep 17 00:00:00 2001 From: Sung-jae Park Date: Thu, 23 May 2013 10:35:50 +0900 Subject: [PATCH] Use the SIGALRM & SIGUSR1 even if the ECORE_ERROR_ABORT is set. Change-Id: I1a252222b49766942c5a0f0963f2b0df92673616 --- src/fault.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/src/fault.c b/src/fault.c index 8910ef3..4e5c09e 100644 --- a/src/fault.c +++ b/src/fault.c @@ -115,30 +115,29 @@ HAPI int fault_init(void) struct sigaction act; char *ecore_abort; - ecore_abort = getenv("ECORE_ERROR_ABORT"); - if (ecore_abort && ecore_abort[0] == '1') { - DbgPrint("Ecore abort is enabled\n"); - return 0; - } - act.sa_sigaction = signal_handler; act.sa_flags = SA_SIGINFO; sigemptyset(&act.sa_mask); - sigaddset(&act.sa_mask, SIGSEGV); - sigaddset(&act.sa_mask, SIGABRT); - sigaddset(&act.sa_mask, SIGILL); + sigaddset(&act.sa_mask, SIGUSR1); sigaddset(&act.sa_mask, SIGALRM); - if (sigaction(SIGSEGV, &act, NULL) < 0) - ErrPrint("Failed to install the SEGV handler\n"); + ecore_abort = getenv("ECORE_ERROR_ABORT"); + if (!ecore_abort || ecore_abort[0] != '1') { + sigaddset(&act.sa_mask, SIGSEGV); + sigaddset(&act.sa_mask, SIGABRT); + sigaddset(&act.sa_mask, SIGILL); + + if (sigaction(SIGSEGV, &act, NULL) < 0) + ErrPrint("Failed to install the SEGV handler\n"); - if (sigaction(SIGABRT, &act, NULL) < 0) - ErrPrint("Faield to install the ABRT handler\n"); + if (sigaction(SIGABRT, &act, NULL) < 0) + ErrPrint("Faield to install the ABRT handler\n"); - if (sigaction(SIGILL, &act, NULL) < 0) - ErrPrint("Faield to install the ILL handler\n"); + if (sigaction(SIGILL, &act, NULL) < 0) + ErrPrint("Faield to install the ILL handler\n"); + } if (sigaction(SIGUSR1, &act, NULL) < 0) ErrPrint("Failed to install the USR1 handler\n"); -- 2.7.4