diff --git a/VERSION b/VERSION index db7a480..28d0075 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.1.31 +0.1.32 diff --git a/event_miner.c b/event_miner.c index 7311692..e8292b4 100644 --- a/event_miner.c +++ b/event_miner.c @@ -321,14 +321,18 @@ static void signal_handler(int sig) { // Log the signal (async-signal-safe functions only) const char* sig_name = get_signal_name(sig); - // Write to stderr using async-signal-safe functions (ignore return values in signal handler) - (void)write(STDERR_FILENO, "\n[SIGNAL] Received ", 19); - (void)write(STDERR_FILENO, sig_name, strlen(sig_name)); - (void)write(STDERR_FILENO, "\n", 1); + // Disable warn_unused_result for signal handler write() calls + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wunused-result" + + // Write to stderr using async-signal-safe functions + write(STDERR_FILENO, "\n[SIGNAL] Received ", 19); + write(STDERR_FILENO, sig_name, strlen(sig_name)); + write(STDERR_FILENO, "\n", 1); // For fatal signals, try emergency shutdown if (sig == SIGSEGV || sig == SIGABRT || sig == SIGFPE || sig == SIGBUS) { - (void)write(STDERR_FILENO, "[SIGNAL] Attempting emergency shutdown...\n", 42); + write(STDERR_FILENO, "[SIGNAL] Attempting emergency shutdown...\n", 42); emergency_shutdown(); // Reset signal handler to default and re-raise @@ -336,10 +340,12 @@ static void signal_handler(int sig) { raise(sig); } else if (sig == SIGINT || sig == SIGTERM) { // Graceful shutdown for interrupt signals - (void)write(STDERR_FILENO, "[SIGNAL] Initiating graceful shutdown...\n", 41); + write(STDERR_FILENO, "[SIGNAL] Initiating graceful shutdown...\n", 41); emergency_shutdown(); } + #pragma GCC diagnostic pop + in_signal_handler = 0; }