From a05b17f1429cb686bac827bd6c0a5ace5e8cba64 Mon Sep 17 00:00:00 2001 From: Kim Woelders Date: Tue, 16 Oct 2018 07:46:39 +0200 Subject: [PATCH] Properly exit on SIGTERM Previously we could get hung when killed, e.g. when using cu. When using minicom or screen this problem did not seem to occur. --- ttynvt.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ttynvt.c b/ttynvt.c index 9814244..581f228 100644 --- a/ttynvt.c +++ b/ttynvt.c @@ -137,6 +137,8 @@ static void sig_handler(int sig) { DBG("Interruped, signal = %d\n", sig); _is_interrupted = 1; + if (sig != SIGUSR2) + exit(0); } static void set_signal_handler(void) @@ -148,6 +150,7 @@ static void set_signal_handler(void) sigemptyset(&(sa.sa_mask)); sa.sa_flags = 0; sigaction(SIGUSR2, &sa, NULL); + sigaction(SIGTERM, &sa, NULL); } static void ttynvt_interrupted(fuse_req_t req, void *data)