diff options
author | John Hawthorn <john@hawthorn.email> | 2018-09-15 18:02:32 -0700 |
---|---|---|
committer | John Hawthorn <john@hawthorn.email> | 2018-09-23 11:23:53 -0700 |
commit | bee40b29cf138165170c15882309e3336e416c6e (patch) | |
tree | 1760ebed4c946e3e0b57a2c859837c1b8882322e /src | |
parent | be1ab6116e50caee4f9dff16e99f0b2c2e1e9277 (diff) |
Better pselect error handling
Diffstat (limited to 'src')
-rw-r--r-- | src/tty.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -7,6 +7,7 @@ #include <sys/ioctl.h> #include <sys/select.h> #include <signal.h> +#include <errno.h> #include "tty.h" @@ -117,7 +118,12 @@ int tty_input_ready(tty_t *tty, long int timeout, int return_on_signal) { return_on_signal ? NULL : &mask); if (err < 0) { - return 0; + if (errno == EINTR) { + return 0; + } else { + perror("select"); + exit(EXIT_FAILURE); + } } else { return FD_ISSET(tty->fdin, &readfs); } |