summaryrefslogtreecommitdiff
path: root/src/utilities.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/utilities.cc')
-rw-r--r--src/utilities.cc16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/utilities.cc b/src/utilities.cc
index f31c7c7..5c88e58 100644
--- a/src/utilities.cc
+++ b/src/utilities.cc
@@ -138,13 +138,15 @@ static void DumpStackTraceAndExit() {
// TOOD(hamaji): Use signal instead of sigaction?
#ifdef HAVE_SIGACTION
- // Set the default signal handler for SIGABRT, to avoid invoking our
- // own signal handler installed by InstallFailedSignalHandler().
- struct sigaction sig_action;
- memset(&sig_action, 0, sizeof(sig_action));
- sigemptyset(&sig_action.sa_mask);
- sig_action.sa_handler = SIG_DFL;
- sigaction(SIGABRT, &sig_action, NULL);
+ if (IsFailureSignalHandlerInstalled()) {
+ // Set the default signal handler for SIGABRT, to avoid invoking our
+ // own signal handler installed by InstallFailureSignalHandler().
+ struct sigaction sig_action;
+ memset(&sig_action, 0, sizeof(sig_action));
+ sigemptyset(&sig_action.sa_mask);
+ sig_action.sa_handler = SIG_DFL;
+ sigaction(SIGABRT, &sig_action, NULL);
+ }
#endif // HAVE_SIGACTION
abort();