version 1.13, 2001/01/29 01:58:10 |
version 1.14, 2001/05/03 20:40:22 |
|
|
exit(1); |
exit(1); |
} |
} |
|
|
#ifndef NO_DPROMPT |
|
/* |
/* |
* A program to return TRUE if we wait for 2 seconds without anything |
* This function returns FALSE if any characters have showed up on the |
* happening, else return FALSE. Cribbed from mod.sources xmodem. |
* tty before 'msec' miliseconds. |
*/ |
*/ |
int |
int |
ttwait() |
ttwait(int msec) |
{ |
{ |
fd_set readfds; |
fd_set readfds; |
struct timeval tmout; |
struct timeval tmout; |
|
|
FD_ZERO(&readfds); |
FD_ZERO(&readfds); |
FD_SET(0, &readfds); |
FD_SET(0, &readfds); |
|
|
tmout.tv_sec = 2; |
tmout.tv_sec = msec/1000; |
tmout.tv_usec = 0; |
tmout.tv_usec = msec - tmout.tv_sec * 1000; |
|
|
if ((select(1, &readfds, NULL, NULL, &tmout)) == 0) |
if ((select(1, &readfds, NULL, NULL, &tmout)) == 0) |
return (TRUE); |
return (TRUE); |
return (FALSE); |
return (FALSE); |
} |
} |
#endif /* NO_DPROMPT */ |
|