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:
parent
62ec122116
commit
103c4d4481
5
main.c
5
main.c
@ -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;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user