summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2014-02-22 11:22:31 +0100
committerTobias Klauser <tklauser@distanz.ch>2014-02-22 11:22:31 +0100
commit8ae7e1b2da35b5374a95b953220f45dbe5043296 (patch)
treef0a7cbc404743beaa109a56327a676b45e0d995d
parent57bd9677a2cb2c7344bc6a72091e707cf43a73f0 (diff)
flowtop: 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>
-rw-r--r--flowtop.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/flowtop.c b/flowtop.c
index d0b9a80..5b0a88c 100644
--- a/flowtop.c
+++ b/flowtop.c
@@ -211,6 +211,8 @@ static void signal_handler(int number)
{
switch (number) {
case SIGINT:
+ case SIGQUIT:
+ case SIGTERM:
sigint = 1;
break;
case SIGHUP:
@@ -1171,6 +1173,8 @@ int main(int argc, char **argv)
rcu_init();
register_signal(SIGINT, signal_handler);
+ register_signal(SIGQUIT, signal_handler);
+ register_signal(SIGTERM, signal_handler);
register_signal(SIGHUP, signal_handler);
init_geoip(1);