Fixed bug preventing Ctrl+C from working properly.

This commit is contained in:
Daniel Beer 2010-05-20 12:30:07 +12:00
parent de80453268
commit d543360bd0
1 changed files with 10 additions and 1 deletions

11
util.c
View File

@ -40,7 +40,16 @@ static void sigint_handler(int signum)
void ctrlc_init(void) 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) void ctrlc_reset(void)