Commit e34af35b authored by Ed Maste's avatar Ed Maste

Fix -Werror build without KJ_HAS_BACKTRACE

This avoids an unused function warning for crashHandler.
parent 01b6d1a9
...@@ -147,6 +147,7 @@ String stringifyStackTrace(ArrayPtr<void* const> trace) { ...@@ -147,6 +147,7 @@ String stringifyStackTrace(ArrayPtr<void* const> trace) {
#endif #endif
} }
#if KJ_HAS_BACKTRACE
namespace { namespace {
void crashHandler(int signo, siginfo_t* info, void* context) { void crashHandler(int signo, siginfo_t* info, void* context) {
...@@ -166,7 +167,6 @@ void crashHandler(int signo, siginfo_t* info, void* context) { ...@@ -166,7 +167,6 @@ void crashHandler(int signo, siginfo_t* info, void* context) {
} // namespace } // namespace
void printStackTraceOnCrash() { void printStackTraceOnCrash() {
#if KJ_HAS_BACKTRACE
// Set up alternate signal stack so that stack overflows can be handled. // Set up alternate signal stack so that stack overflows can be handled.
stack_t stack; stack_t stack;
memset(&stack, 0, sizeof(stack)); memset(&stack, 0, sizeof(stack));
...@@ -207,8 +207,11 @@ void printStackTraceOnCrash() { ...@@ -207,8 +207,11 @@ void printStackTraceOnCrash() {
// because stack traces on ctrl+c can be obnoxious for, say, command-line tools. // because stack traces on ctrl+c can be obnoxious for, say, command-line tools.
KJ_SYSCALL(sigaction(SIGINT, &action, nullptr)); KJ_SYSCALL(sigaction(SIGINT, &action, nullptr));
#endif #endif
#endif
} }
#else
void printStackTraceOnCrash() {
}
#endif
kj::StringPtr trimSourceFilename(kj::StringPtr filename) { kj::StringPtr trimSourceFilename(kj::StringPtr filename) {
// Removes noisy prefixes from source code file name. // Removes noisy prefixes from source code file name.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment