summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDiogo Franco (Kovensky) <diogomfranco@gmail.com>2013-07-26 15:51:48 -0300
committerDiogo Franco (Kovensky) <diogomfranco@gmail.com>2013-07-26 15:51:48 -0300
commit630edc0637a74e86c71bd4830793a2b50b91481b (patch)
treeaebb657a73847c0ae059f2109977df34a3f66c2f
parent15742504d0065899106a5a888501fe54d8970d99 (diff)
downloadmpv-630edc0637a74e86c71bd4830793a2b50b91481b.tar.bz2
mpv-630edc0637a74e86c71bd4830793a2b50b91481b.tar.xz
getch2: Deactivate getch2 on SIGINT; also handle SIGQUIT
-rw-r--r--osdep/getch2.c4
1 files changed, 4 insertions, 0 deletions
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();