From 8fbad2cb9c26e53debfddb1ae8533dd95bbf47ba Mon Sep 17 00:00:00 2001 From: Sergiu Deitsch Date: Fri, 5 Jan 2024 00:13:04 +0100 Subject: [PATCH] feat: make IsFailureSignalHandlerInstalled public (#1033) --- 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 76341c2..f8cb788 100644 --- a/src/glog/logging.h +++ b/src/glog/logging.h @@ -959,9 +959,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) \ @@ -1648,6 +1645,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 2e15df2..992fffb 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.