Skip to content

Commit

Permalink
Fix future SIGSTKSZ constant issue
Browse files Browse the repository at this point in the history
  • Loading branch information
raub committed Oct 30, 2024
1 parent 934b025 commit ed4f546
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/cpp/segfault-handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@

namespace segfault {

char logFilePath[512] = "segfault.log";
constexpr int SIGSTKSZ_LOCAL = 1024 * 128;

char logFilePath[512] = "segfault.log";
time_t timeInfo;

inline bool _checkExists(const char* name) {
if (FILE *file = fopen(name, "r")) {
Expand All @@ -46,16 +48,14 @@ inline bool _checkExists(const char* name) {
#define HANDLER_CANCEL return
#define HANDLER_DONE return

char _altStackBytes[SIGSTKSZ];
char _altStackBytes[SIGSTKSZ_LOCAL];
stack_t _altStack = {
_altStackBytes,
0,
SIGSTKSZ,
SIGSTKSZ_LOCAL,
};
#endif

time_t timeInfo;

const std::map<uint32_t, std::string> signalNames = {
#ifdef _WIN32
#define EXCEPTION_ALL 0x0
Expand Down Expand Up @@ -115,7 +115,6 @@ const std::map<uint32_t, std::string> signalNames = {
#endif
};


std::map<uint32_t, bool> signalActivity = {
#ifdef _WIN32
{ EXCEPTION_ALL, false },
Expand Down

0 comments on commit ed4f546

Please sign in to comment.