]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - client/util.c
FIX: tcgetattr for Linux in Ukbhit(), should return -1 if fail.
[proxmark3-svn] / client / util.c
index 5b461649f8451222b26c5be48b36e30f0f8e5b4b..9d4c83ee2b975e997a6db42e1b3eb8c9e9061b48 100644 (file)
@@ -21,14 +21,14 @@ int ukbhit(void)
   int error;
   static struct termios Otty, Ntty;
 
-  if ( tcgetattr( 0, &Otty) == -1) return false;
+  if ( tcgetattr( 0, &Otty) == -1) return -1;
   Ntty = Otty;
 
-  Ntty.c_iflag          = 0;       /* input mode                */
-  Ntty.c_oflag          = 0;       /* output mode               */
-  Ntty.c_lflag         &= ~ICANON; /* raw mode */
-  Ntty.c_cc[VMIN]       = CMIN;    /* minimum time to wait      */
-  Ntty.c_cc[VTIME]      = CTIME;   /* minimum characters to wait for */
+  Ntty.c_iflag         = 0;       /* input mode                */
+  Ntty.c_oflag         = 0;       /* output mode               */
+  Ntty.c_lflag         &= ~ICANON; /* raw mode */
+  Ntty.c_cc[VMIN]      = CMIN;    /* minimum time to wait      */
+  Ntty.c_cc[VTIME]     = CTIME;   /* minimum characters to wait for */
 
   if (0 == (error = tcsetattr(0, TCSANOW, &Ntty))) {
     error += ioctl(0, FIONREAD, &cnt);
Impressum, Datenschutz