From b0a0bea8167de911102fdb3996abe3ad872888f3 Mon Sep 17 00:00:00 2001 From: Sergiu Deitsch Date: Thu, 4 Jan 2024 23:17:49 +0100 Subject: [PATCH] feat: make IsFailureSignalHandlerInstalled public --- src/glog/logging.h | 6 +++--- src/signalhandler.cc | 4 ---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/glog/logging.h b/src/glog/logging.h index 30f313b53..63cf241fa 100644 --- a/src/glog/logging.h +++ b/src/glog/logging.h @@ -967,9 +967,6 @@ template struct CompileAssert {}; struct CrashReason; -// Returns true if FailureSignalHandler is installed. -// Needs to be exported since it's used by the signalhandler_unittest. -GLOG_EXPORT bool IsFailureSignalHandlerInstalled(); } // namespace glog_internal_namespace_ #define LOG_EVERY_N(severity, n) \ @@ -1656,6 +1653,9 @@ class GLOG_EXPORT NullStreamFatal : public NullStream { // words, stack traces of other threads won't be shown. GLOG_EXPORT void InstallFailureSignalHandler(); +// Returns true if FailureSignalHandler is installed. +GLOG_EXPORT bool IsFailureSignalHandlerInstalled(); + // Installs a function that is used for writing the failure dump. "data" // is the pointer to the beginning of a message to be written, and "size" // is the size of the message. You should not expect the data is diff --git a/src/signalhandler.cc b/src/signalhandler.cc index 2e15df21d..992fffb1f 100644 --- a/src/signalhandler.cc +++ b/src/signalhandler.cc @@ -348,8 +348,6 @@ void FailureSignalHandler(int signal_number, siginfo_t* signal_info, } // namespace -namespace glog_internal_namespace_ { - bool IsFailureSignalHandlerInstalled() { #ifdef HAVE_SIGACTION // TODO(andschwa): Return kFailureSignalHandlerInstalled? @@ -366,8 +364,6 @@ bool IsFailureSignalHandlerInstalled() { return false; } -} // namespace glog_internal_namespace_ - void InstallFailureSignalHandler() { #ifdef HAVE_SIGACTION // Build the sigaction struct.