Skip to content

Commit

Permalink
fix compilation error
Browse files Browse the repository at this point in the history
  • Loading branch information
goblinhack committed Jan 24, 2025
1 parent 7a03589 commit 832fd21
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/signal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ std::string callstack_string(void)
#define PATH_MAX 512
#endif

#ifndef __APPLE__
#if defined __linux__
//
// I can only really get this working with linux
//
static void debug_crash_handler(int sig)
{
fprintf(stderr, "debug_crash_handler: Error: Signal %d:\n", sig);
Expand Down Expand Up @@ -104,7 +107,6 @@ static void debug_crash_handler(int sig)
// Permissions for GDB
//
prctl(PR_SET_PTRACER, PR_SET_PTRACER_ANY, 0, 0, 0);
#endif

auto child = fork();
if (! child) {
Expand All @@ -123,6 +125,7 @@ static void debug_crash_handler(int sig)
//
waitpid(child, nullptr, 0);
}
#endif
}
#endif

Expand Down Expand Up @@ -156,14 +159,10 @@ void common_error_handler(std::string &tech_support)
void segv_handler(int sig)
{
TRACE_AND_INDENT();

std::string tech_support = "Sorry, a crash has occurred!";
common_error_handler(tech_support);

#ifdef __APPLE__
//
// Can't get it to work.
//
#else
#if defined __linux__
debug_crash_handler(sig);
#endif

Expand Down

0 comments on commit 832fd21

Please sign in to comment.