Browse Source

Add signal handler for SIGTERM

As the benchmark runner doesn’t send a SIGINT but a SIGTERM, the signal
handler printing the statistics wasn’t triggered.
master
Patrick Lühne 4 years ago
parent
commit
103c4d4481
No known key found for this signature in database GPG Key ID: 5F3611E97A70ABF
  1. 5
      main.c

5
main.c

@ -287,14 +287,15 @@ void printStatistics()
printf("...\n");
}
void handleSIGINT()
void handleSignal()
{
printStatistics();
exit(0);
}
int main(int argc,char **argv) {
signal(SIGINT, handleSIGINT);
signal(SIGINT, handleSignal);
signal(SIGTERM, handleSignal);
int i,j;

Loading…
Cancel
Save