summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Hawthorn <john@hawthorn.email>2018-09-15 18:02:32 -0700
committerJohn Hawthorn <john@hawthorn.email>2018-09-23 11:23:53 -0700
commitbee40b29cf138165170c15882309e3336e416c6e (patch)
tree1760ebed4c946e3e0b57a2c859837c1b8882322e /src
parentbe1ab6116e50caee4f9dff16e99f0b2c2e1e9277 (diff)
Better pselect error handling
Diffstat (limited to 'src')
-rw-r--r--src/tty.c8
1 files changed, 7 insertions, 1 deletions
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 <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);
}