From a8cdc4470aa1ce774da3f321630b376432a14c4a Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Fri, 23 Sep 2016 17:13:45 +1000 Subject: [PATCH] Raise the original signal on exiting signal handler in ckpmsg --- src/ckpmsg.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ckpmsg.c b/src/ckpmsg.c index 0765e2cc..206b9056 100644 --- a/src/ckpmsg.c +++ b/src/ckpmsg.c @@ -97,12 +97,15 @@ static struct option long_options[] = { struct termios oldctrl; -static void sighandler(const int __maybe_unused sig) +static void sighandler(const int sig) { /* Return console to its previous state */ tcsetattr(STDIN_FILENO, TCSANOW, &oldctrl); - exit(0); + if (sig) { + signal (sig, SIG_DFL); + raise (sig); + } } int get_line(char **buf)