summaryrefslogtreecommitdiff
path: root/src/tty.c
diff options
context:
space:
mode:
authorJason Felice <jason.m.felice@gmail.com>2018-05-04 12:32:40 -0400
committerJason Felice <jason.m.felice@gmail.com>2018-05-04 12:32:40 -0400
commitbaa0d7ece4eb8401a61a0bebdb5264bf805a34c2 (patch)
tree6eb6d5717b792504b93bd8a0eae275942fe00425 /src/tty.c
parent39ce2809029e3273ed212d9b31ffa350f12d521c (diff)
Abort if Esc is pressed
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 0d53797..357b068 100644
--- a/src/tty.c
+++ b/src/tty.c
@@ -87,9 +87,9 @@ char tty_getchar(tty_t *tty) {
}
}
-int tty_input_ready(tty_t *tty) {
+int tty_input_ready(tty_t *tty, int pending) {
fd_set readfs;
- struct timeval tv = {0, 0};
+ struct timeval tv = {0, pending ? 500000 : 0};
FD_ZERO(&readfs);
FD_SET(tty->fdin, &readfs);
select(tty->fdin + 1, &readfs, NULL, NULL, &tv);