[blog] Cleanup support in Signal Hook


I noticed a small error:

The trick here is to reset the signal handler to its OS default after receiving the first signal. The default for many signals, including SIGTERM (the one coming from CTRL+C ) is to terminate the program.

CTRL+C triggers SIGINT, not SIGTERM.

Right, thanks, fixed (nevertheless, one usually wants to handle all of SIGTERM, SIGINT and SIGQUIT together).

1 Like