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:
Patrick Lühne 2018-02-01 14:45:00 +01:00
parent 62ec122116
commit 103c4d4481
Signed by: patrick
GPG Key ID: 05F3611E97A70ABF

5
main.c
View File

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