Merge pull request #28 from jwilk/error-handling

Fix error handling for select()
This commit is contained in:
Martin Lund 2016-05-09 22:19:36 +02:00
commit daa7d496ba

View file

@ -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))
{