From bee40b29cf138165170c15882309e3336e416c6e Mon Sep 17 00:00:00 2001 From: John Hawthorn Date: Sat, 15 Sep 2018 18:02:32 -0700 Subject: Better pselect error handling --- src/tty.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/tty.c b/src/tty.c index 2481475..f8de9f5 100644 --- a/src/tty.c +++ b/src/tty.c @@ -7,6 +7,7 @@ #include #include #include +#include #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); } -- cgit v1.2.3