From bfe5c07279e601fd7dca95088efa43885e892a31 Mon Sep 17 00:00:00 2001 From: Jakub Wilk Date: Mon, 9 May 2016 22:04:56 +0200 Subject: [PATCH] Fix error handling for select() Previously the error handling code for select() was unreachable. --- src/tty.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tty.c b/src/tty.c index 7449919..a8a7cf8 100644 --- a/src/tty.c +++ b/src/tty.c @@ -72,7 +72,7 @@ void wait_for_tty_device(void) /* Block until input becomes available or timeout */ status = select(STDIN_FILENO + 1, &rdfs, NULL, NULL, &tv); - if (status) + if (status > 0) { /* Input from stdin ready */ @@ -229,7 +229,7 @@ int connect_tty(void) /* Block until input becomes available */ status = select(maxfd, &rdfs, NULL, NULL, NULL); - if (status) + if (status > 0) { if (FD_ISSET(fd, &rdfs)) {