mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 21:33:47 -07: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;
|
int error;
|
||||||
static struct termios Otty, Ntty;
|
static struct termios Otty, Ntty;
|
||||||
|
|
||||||
if ( tcgetattr( 0, &Otty) == -1) return false;
|
if ( tcgetattr( 0, &Otty) == -1) return -1;
|
||||||
Ntty = Otty;
|
Ntty = Otty;
|
||||||
|
|
||||||
Ntty.c_iflag = 0; /* input mode */
|
Ntty.c_iflag = 0; /* input mode */
|
||||||
Ntty.c_oflag = 0; /* output mode */
|
Ntty.c_oflag = 0; /* output mode */
|
||||||
Ntty.c_lflag &= ~ICANON; /* raw mode */
|
Ntty.c_lflag &= ~ICANON; /* raw mode */
|
||||||
Ntty.c_cc[VMIN] = CMIN; /* minimum time to wait */
|
Ntty.c_cc[VMIN] = CMIN; /* minimum time to wait */
|
||||||
Ntty.c_cc[VTIME] = CTIME; /* minimum characters to wait for */
|
Ntty.c_cc[VTIME] = CTIME; /* minimum characters to wait for */
|
||||||
|
|
||||||
if (0 == (error = tcsetattr(0, TCSANOW, &Ntty))) {
|
if (0 == (error = tcsetattr(0, TCSANOW, &Ntty))) {
|
||||||
error += ioctl(0, FIONREAD, &cnt);
|
error += ioctl(0, FIONREAD, &cnt);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue