Skip to content
Snippets Groups Projects
Commit 0c6e5ac3 authored by George Nachman's avatar George Nachman Committed by GitHub
Browse files

Merge pull request #327 from grimreaper/eax/ato/enox

Fix bug with signal handling in catch.c
parents c5d46087 c1941e95
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -2,8 +2,10 @@
#include <signal.h>
#include <unistd.h>
 
sig_atomic_t caught_sigint = 0;
void InterruptHandler(int signo) {
printf("Caught SIGINT\n");
caught_sigint = 1;
}
 
int main(int argc, char *argv[]) {
Loading
Loading
@@ -14,7 +16,9 @@ int main(int argc, char *argv[]) {
 
while(1) {
sleep(1);
if (caught_sigint) {
printf("Caught SIGINT\n");
caught_sigint = 0;
}
}
return 0;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment