From 57bd9677a2cb2c7344bc6a72091e707cf43a73f0 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Sat, 22 Feb 2014 11:21:10 +0100 Subject: astraceroute: Exit gracefully for all possible termination signals Handle all termination signals that we're allowed to handle (SIGKILL can't be handled) in order to exit gracefully in any regular termination case. Signed-off-by: Tobias Klauser --- astraceroute.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/astraceroute.c b/astraceroute.c index 84c6649..c7c3514 100644 --- a/astraceroute.c +++ b/astraceroute.c @@ -168,6 +168,8 @@ static void signal_handler(int number) { switch (number) { case SIGINT: + case SIGQUIT: + case SIGTERM: sigint = 1; default: break; @@ -1089,6 +1091,8 @@ int main(int argc, char **argv) register_signal(SIGHUP, signal_handler); register_signal(SIGINT, signal_handler); + register_signal(SIGQUIT, signal_handler); + register_signal(SIGTERM, signal_handler); tprintf_init(); init_geoip(1); -- cgit v1.2.3-54-g00ecf