Skip to content

Commit de5d650

Browse files
committed
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>
1 parent e1b18d7 commit de5d650

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

pping/pping.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,6 +1024,7 @@ int main(int argc, char *argv[])
10241024

10251025
// Allow program to perform cleanup on Ctrl-C
10261026
signal(SIGINT, abort_program);
1027+
signal(SIGTERM, abort_program);
10271028

10281029
// Main loop
10291030
while (keep_running) {

0 commit comments

Comments
 (0)