diff options
author | John Hawthorn <john@hawthorn.email> | 2018-09-15 13:55:10 -0700 |
---|---|---|
committer | John Hawthorn <john@hawthorn.email> | 2018-09-23 11:23:53 -0700 |
commit | 76e5f30d19b0d9306a192d48ebad3d17a29bc3cf (patch) | |
tree | d3863d35188c5311d6537c848198b69a0c3f127a /src/tty.c | |
parent | 249b6c94a90ce03dd79cac23ba7d03e3bc7cd164 (diff) |
Pass a timeout to tty_input_ready
Diffstat (limited to 'src/tty.c')
-rw-r--r-- | src/tty.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -89,9 +89,9 @@ char tty_getchar(tty_t *tty) { } } -int tty_input_ready(tty_t *tty, int pending) { +int tty_input_ready(tty_t *tty, unsigned long timeout) { fd_set readfs; - struct timeval tv = {0, pending ? (KEYTIMEOUT * 1000) : 0}; + struct timeval tv = {timeout / 1000, (timeout % 1000) * 1000}; FD_ZERO(&readfs); FD_SET(tty->fdin, &readfs); select(tty->fdin + 1, &readfs, NULL, NULL, &tv); |