Skip to content

Commit

Permalink
feat: make IsFailureSignalHandlerInstalled public
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiud committed Jan 4, 2024
1 parent f3bee1b commit b0a0bea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/glog/logging.h
Original file line number Diff line number Diff line change
Expand Up @@ -967,9 +967,6 @@ template <bool>
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) \
Expand Down Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions src/signalhandler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand All @@ -366,8 +364,6 @@ bool IsFailureSignalHandlerInstalled() {
return false;
}

} // namespace glog_internal_namespace_

void InstallFailureSignalHandler() {
#ifdef HAVE_SIGACTION
// Build the sigaction struct.
Expand Down

0 comments on commit b0a0bea

Please sign in to comment.