[Mplayer-cvslog] CVS: main/linux getch2.c,1.5,1.6

Arpi of Ize arpi at mplayer.dev.hu
Wed Aug 22 21:43:25 CEST 2001


Update of /cvsroot/mplayer/main/linux
In directory mplayer:/var/tmp.root/cvs-serv26245

Modified Files:
	getch2.c 
Log Message:
status management

Index: getch2.c
===================================================================
RCS file: /cvsroot/mplayer/main/linux/getch2.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- getch2.c	6 Aug 2001 14:03:37 -0000	1.5
+++ getch2.c	22 Aug 2001 19:43:23 -0000	1.6
@@ -199,6 +199,8 @@
   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 @@
 #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 @@
 #else
     ioctl(0,TCSETS,&tio_orig);
 #endif
+    getch2_status=0;
 }
 




More information about the MPlayer-cvslog mailing list