summaryrefslogtreecommitdiff
path: root/astraceroute.c
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2014-02-22 11:21:10 +0100
committerTobias Klauser <tklauser@distanz.ch>2014-02-22 11:21:10 +0100
commit57bd9677a2cb2c7344bc6a72091e707cf43a73f0 (patch)
tree554d778118f16123d60eb399bd0425b8c6d7c780 /astraceroute.c
parent752a83809f667c35cd4e8e84c7b4f380c0afd9b0 (diff)
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 <tklauser@distanz.ch>
Diffstat (limited to 'astraceroute.c')
-rw-r--r--astraceroute.c4
1 files changed, 4 insertions, 0 deletions
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);