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 2018-02-01 14:45:00 +01:00
parent 62ec122116
commit 103c4d4481
No known key found for this signature in database
GPG Key ID: 05F3611E97A70ABF
1 changed files with 3 additions and 2 deletions

5
main.c
View File

@ -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;