From 103c4d44812f025241e818e5a60834b11a3a9827 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20L=C3=BChne?= Date: Thu, 1 Feb 2018 14:45:00 +0100 Subject: [PATCH] Add signal handler for SIGTERM MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As the benchmark runner doesn’t send a SIGINT but a SIGTERM, the signal handler printing the statistics wasn’t triggered. --- main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index 5523d0b..0d30ef5 100644 --- a/main.c +++ b/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;