From 630edc0637a74e86c71bd4830793a2b50b91481b Mon Sep 17 00:00:00 2001 From: "Diogo Franco (Kovensky)" Date: Fri, 26 Jul 2013 15:51:48 -0300 Subject: getch2: Deactivate getch2 on SIGINT; also handle SIGQUIT --- osdep/getch2.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'osdep') diff --git a/osdep/getch2.c b/osdep/getch2.c index f02f20e49c..091f000cda 100644 --- a/osdep/getch2.c +++ b/osdep/getch2.c @@ -541,6 +541,8 @@ static void continue_sighandler(int signum) static void quit_request_sighandler(int signum) { + do_deactivate_getch2(); + async_quit_request = 1; } @@ -552,6 +554,7 @@ void getch2_enable(void){ setsigaction(SIGCONT, continue_sighandler, 0, true); setsigaction(SIGTSTP, stop_sighandler, SA_RESETHAND, false); setsigaction(SIGINT, quit_request_sighandler, SA_RESETHAND, false); + setsigaction(SIGQUIT, quit_request_sighandler, SA_RESETHAND, false); setsigaction(SIGTTIN, SIG_IGN, 0, true); do_activate_getch2(); @@ -567,6 +570,7 @@ void getch2_disable(void){ setsigaction(SIGCONT, SIG_DFL, 0, false); setsigaction(SIGTSTP, SIG_DFL, 0, false); setsigaction(SIGINT, SIG_DFL, 0, false); + setsigaction(SIGQUIT, SIG_DFL, 0, false); setsigaction(SIGTTIN, SIG_DFL, 0, false); do_deactivate_getch2(); -- cgit v1.2.3