summaryrefslogtreecommitdiff
path: root/src/signalhandler.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/signalhandler.cc')
-rw-r--r--src/signalhandler.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/signalhandler.cc b/src/signalhandler.cc
index cccd800..a7aef8b 100644
--- a/src/signalhandler.cc
+++ b/src/signalhandler.cc
@@ -335,6 +335,22 @@ void FailureSignalHandler(int signal_number,
#endif // HAVE_SIGACTION
+namespace glog_internal_namespace_ {
+
+bool IsFailureSignalHandlerInstalled() {
+#ifdef HAVE_SIGACTION
+ struct sigaction sig_action;
+ memset(&sig_action, 0, sizeof(sig_action));
+ sigemptyset(&sig_action.sa_mask);
+ sigaction(SIGABRT, NULL, &sig_action);
+ if (sig_action.sa_sigaction == &FailureSignalHandler)
+ return true;
+#endif // HAVE_SIGACTION
+ return false;
+}
+
+} // namespace glog_internal_namespace_
+
void InstallFailureSignalHandler() {
#ifdef HAVE_SIGACTION
// Build the sigaction struct.