diff options
author | John Hawthorn <john@hawthorn.email> | 2018-09-15 14:12:14 -0700 |
---|---|---|
committer | John Hawthorn <john@hawthorn.email> | 2018-09-23 11:23:53 -0700 |
commit | dc0a9a8e2d56ad9d7b7879fac9935787ce7e8043 (patch) | |
tree | d9f8eeb84b55d5eac98120081d746f0833fe1f94 /src | |
parent | 83e6fedf9b4c436a4adbdc136d5617a783a1e1e8 (diff) |
Return 0 on pselect EINTR
Diffstat (limited to 'src')
-rw-r--r-- | src/tty.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -96,8 +96,13 @@ int tty_input_ready(tty_t *tty, unsigned long timeout) { struct timespec ts = {timeout / 1000, (timeout % 1000) * 1000000}; - pselect(tty->fdin + 1, &readfs, NULL, NULL, &ts, NULL); - return FD_ISSET(tty->fdin, &readfs); + int err = pselect(tty->fdin + 1, &readfs, NULL, NULL, &ts, NULL); + + if (err < 0) { + return 0; + } else { + return FD_ISSET(tty->fdin, &readfs); + } } static void tty_sgr(tty_t *tty, int code) { |