diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2014-02-22 11:24:06 +0100 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2014-02-22 11:24:06 +0100 |
commit | ed28a9fba251450b3a15a95f4dcaa8ca4fd4d7be (patch) | |
tree | 86c823549f24809959baa124ca9cd6f3e6606264 | |
parent | 8ae7e1b2da35b5374a95b953220f45dbe5043296 (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.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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(); |