| Date: Fri, 16 Nov 2018 22:24:06 +0100
Handle SIGHUP and SIGTERM
Killing a terminal where sacc is running will send SIGHUP to sacc.
With this patch, sacc is handling SIGHUP and SIGTERM and cleans up
ttemporary files properly.
Diffstat:
sacc.c | 2 ++
1 file changed, 2 insertions(+), 0 deletions(-)
--- |
| t@@ -958,6 +958,8 @@ setup(void)
sa.sa_flags = SA_RESTART;
sa.sa_handler = exit;
sigaction(SIGINT, &sa, NULL);
+ sigaction(SIGHUP, &sa, NULL);
+ sigaction(SIGTERM, &sa, NULL);
if (mkdir(tmpdir, S_IRWXU) < 0 && errno != EEXIST)
die("mkdir: %s: %s", tmpdir, strerror(errno)); |