version 1.10, 2001/09/04 23:35:59 |
version 1.11, 2001/09/05 06:25:39 |
|
|
|
|
/* set up arguments for select with timeout */ |
/* set up arguments for select with timeout */ |
FD_ZERO(&readfds); |
FD_ZERO(&readfds); |
FD_SET(1, &readfds); /* for standard input */ |
FD_SET(STDIN_FILENO, &readfds); /* for standard input */ |
timeout.tv_sec = delay; |
timeout.tv_sec = delay; |
timeout.tv_usec = 0; |
timeout.tv_usec = 0; |
|
|
|
|
} |
} |
|
|
/* wait for either input or the end of the delay period */ |
/* wait for either input or the end of the delay period */ |
if (select(32, &readfds, (fd_set *)NULL, (fd_set *)NULL, &timeout) > 0) |
if (select(STDIN_FILENO + 1, &readfds, (fd_set *)NULL, |
|
(fd_set *)NULL, &timeout) > 0) |
{ |
{ |
int newval; |
int newval; |
char *errmsg; |
char *errmsg; |