summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/tty.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/tty.c b/src/tty.c
index 38a9f2f..c84606e 100644
--- a/src/tty.c
+++ b/src/tty.c
@@ -91,10 +91,12 @@ char tty_getchar(tty_t *tty) {
int tty_input_ready(tty_t *tty, unsigned long timeout) {
fd_set readfs;
- struct timeval tv = {timeout / 1000, (timeout % 1000) * 1000};
FD_ZERO(&readfs);
FD_SET(tty->fdin, &readfs);
- select(tty->fdin + 1, &readfs, NULL, NULL, &tv);
+
+ struct timespec ts = {timeout / 1000, (timeout % 1000) * 1000000};
+
+ pselect(tty->fdin + 1, &readfs, NULL, NULL, &ts, NULL);
return FD_ISSET(tty->fdin, &readfs);
}