From 13b2c93583ba9dd89e4b82060f6a71adf539d7c2 Mon Sep 17 00:00:00 2001 From: Francesco Date: Sat, 25 Oct 2025 01:31:40 +0200 Subject: [PATCH] refactor(main): remove posix define --- src/main.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/main.c b/src/main.c index 90d157e..4ec9bc8 100644 --- a/src/main.c +++ b/src/main.c @@ -1,5 +1,3 @@ -#define _XOPEN_SOURCE 1 - #include #include #include @@ -15,14 +13,8 @@ void cws_signal_handler(int) { } int main(void) { - struct sigaction act = {.sa_handler = cws_signal_handler, .sa_flags = 0, .sa_mask = {{0}}}; - if (sigaction(SIGINT, &act, NULL)) { - CWS_LOG_ERROR("sigaction()"); - return EXIT_FAILURE; - } - - if (sigaction(SIGTERM, &act, NULL)) { - CWS_LOG_ERROR("sigaction()"); + if (signal(SIGINT, cws_signal_handler) == SIG_ERR) { + CWS_LOG_ERROR("signal()"); return EXIT_FAILURE; }