summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2014-02-22 11:24:06 +0100
committerTobias Klauser <tklauser@distanz.ch>2014-02-22 11:24:06 +0100
commited28a9fba251450b3a15a95f4dcaa8ca4fd4d7be (patch)
tree86c823549f24809959baa124ca9cd6f3e6606264
parent8ae7e1b2da35b5374a95b953220f45dbe5043296 (diff)
ifpps: 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--ifpps.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ifpps.c b/ifpps.c
index ff9eaad..6c0387b 100644
--- a/ifpps.c
+++ b/ifpps.c
@@ -96,6 +96,8 @@ static void signal_handler(int number)
{
switch (number) {
case SIGINT:
+ case SIGQUIT:
+ case SIGTERM:
sigint = 1;
break;
case SIGHUP:
@@ -1401,6 +1403,8 @@ int main(int argc, char **argv)
panic("This is no networking device!\n");
register_signal(SIGINT, signal_handler);
+ register_signal(SIGQUIT, signal_handler);
+ register_signal(SIGSTOP, signal_handler);
register_signal(SIGHUP, signal_handler);
cpus = get_number_cpus();