summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-08-22 19:43:23 +0000
committerarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-08-22 19:43:23 +0000
commitb0dbb726dc7f50b35e129c39ecbc0536a9a3fbb1 (patch)
tree68f2ee40e9839bc1b6570435784cd79460c81e2c
parent6326452f41e74675009120c7b9251bb2d7f8be0b (diff)
downloadmpv-b0dbb726dc7f50b35e129c39ecbc0536a9a3fbb1.tar.bz2
mpv-b0dbb726dc7f50b35e129c39ecbc0536a9a3fbb1.tar.xz
status management
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@1633 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--linux/getch2.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/linux/getch2.c b/linux/getch2.c
index b302e2d59b..621adf5a84 100644
--- a/linux/getch2.c
+++ b/linux/getch2.c
@@ -199,6 +199,8 @@ found:
return code;
}
+static int getch2_status=0;
+
void getch2_enable(){
struct termios tio_new;
#if defined(__NetBSD__) || defined(__svr4__) || defined(__CYGWIN__)
@@ -219,9 +221,11 @@ struct termios tio_new;
#else
ioctl(0,TCSETS,&tio_new);
#endif
+ getch2_status=1;
}
void getch2_disable(){
+ if(!getch2_status) return; // already disabled / never enabled
#if defined(__NetBSD__) || defined(__svr4__) || defined(__CYGWIN__)
tcsetattr(0,TCSANOW,&tio_orig);
#elif defined(__FreeBSD__) || defined(__OpenBSD__)
@@ -229,5 +233,6 @@ void getch2_disable(){
#else
ioctl(0,TCSETS,&tio_orig);
#endif
+ getch2_status=0;
}