From d543360bd05056df0d521175705125b5b0d85506 Mon Sep 17 00:00:00 2001 From: Daniel Beer Date: Thu, 20 May 2010 12:30:07 +1200 Subject: [PATCH] Fixed bug preventing Ctrl+C from working properly. --- util.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/util.c b/util.c index 0ed1d01..bdf1aab 100644 --- a/util.c +++ b/util.c @@ -40,7 +40,16 @@ static void sigint_handler(int signum) void ctrlc_init(void) { - signal(SIGINT, sigint_handler); +#ifdef WIN32 + signal(SIGINT, sigint_handler); +#else + const static struct sigaction siga = { + .sa_handler = sigint_handler, + .sa_flags = 0 + }; + + sigaction(SIGINT, &siga, NULL); +#endif } void ctrlc_reset(void)