pping: Add graceful shutdown on SIGTERM

Also intercept SIGTERM (in addition the the previously intercepted
SIGINT) and perform graceful shutdown.

Perhaps it also makes sense to perform graceful shutdown on some
additional signals, like SIGHUP and SIGQUIT?

Signed-off-by: Simon Sundberg <simon.sundberg@kau.se>
This commit is contained in:
Simon Sundberg
2022-01-31 18:47:08 +01:00
parent e1b18d7b12
commit de5d65030c

View File

@ -1024,6 +1024,7 @@ int main(int argc, char *argv[])
// Allow program to perform cleanup on Ctrl-C
signal(SIGINT, abort_program);
signal(SIGTERM, abort_program);
// Main loop
while (keep_running) {