mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2024-12-31 04:39:49 +08:00
FIX: tcgetattr for Linux in Ukbhit(), should return -1 if fail.
This commit is contained in:
parent
f37fe8cb10
commit
d04b71c168
1 changed files with 6 additions and 6 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue