Skip to content

Commit

Permalink
Handle SIGINT
Browse files Browse the repository at this point in the history
  • Loading branch information
cbdevnet committed Dec 11, 2016
1 parent 0f9b4a0 commit 639133b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion xlaser.c
Expand Up @@ -13,6 +13,10 @@ int getHelp() {
return 0;
}

void signal_handler(int param) {
abort_signaled = 1;
}

int main(int argc, char** argv){
unsigned u;
CONFIG config = {
Expand Down Expand Up @@ -50,7 +54,10 @@ int main(int argc, char** argv){
}

//TODO sanity check config
//TODO set up signal handlers
//set up signal handler
signal(SIGINT, signal_handler);

//initialize x11 resources & backend
if(x11_init(&xres, &config) < 0){
fprintf(stderr, "Failed to initialize window\n");
exit(usage(argv[0]));
Expand Down

0 comments on commit 639133b

Please sign in to comment.