summaryrefslogtreecommitdiff
path: root/src/tty.c
diff options
context:
space:
mode:
authorJohn Hawthorn <john@hawthorn.email>2018-09-15 13:55:10 -0700
committerJohn Hawthorn <john@hawthorn.email>2018-09-23 11:23:53 -0700
commit76e5f30d19b0d9306a192d48ebad3d17a29bc3cf (patch)
treed3863d35188c5311d6537c848198b69a0c3f127a /src/tty.c
parent249b6c94a90ce03dd79cac23ba7d03e3bc7cd164 (diff)
Pass a timeout to tty_input_ready
Diffstat (limited to 'src/tty.c')
-rw-r--r--src/tty.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tty.c b/src/tty.c
index c30100b..38a9f2f 100644
--- a/src/tty.c
+++ b/src/tty.c
@@ -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);