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.
This commit is contained in:
2018-02-01 14:45:00 +01:00
parent 62ec122116
commit 103c4d4481

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;