Diff for libplaton/platon/misc/kbhit.c between version 1.1 and 1.2
| version 1.1, 2001/10/05 13:42:11 |
version 1.2, 2001/10/05 18:14:54 |
|
|
| if(!init){ |
if(!init){ |
| init=1; |
init=1; |
| if((handle=open("/dev/tty",O_RDWR|O_SYNC))==-1){ |
if((handle=open("/dev/tty",O_RDWR|O_SYNC))==-1){ |
| |
#if 0 |
| fputs("kbhit() ERROR: Cannot read from terminal!\n",stderr); |
fputs("kbhit() ERROR: Cannot read from terminal!\n",stderr); |
| exit(1); |
#endif |
| |
return -1; |
| } |
} |
| else{ |
else { |
| tcgetattr(handle,&old_term); |
tcgetattr(handle,&old_term); |
| new_term=old_term; |
new_term=old_term; |
| new_term.c_lflag&=~ICANON; |
new_term.c_lflag&=~ICANON; |
Platon Group <platon@platon.org> http://platon.org/
|
|