hwhw/kindlepdfviewer — pull request #636 by chrox (2012-11-25 08:22:58+00:00)
Title: bugfix: waitForInput should return error when select returns zero

On the RETURN VALUE section of `man select` it says:
```
On success, select() and pselect() return the number of file descriptors contained
in the three returned descriptor sets (that is, the total number of bits that are
set in readfds, writefds, exceptfds) which may be zero if the timeout expires
before anything interesting happens. On error, -1 is returned, and errno is set
appropriately; the sets and timeout become undefined, so do not rely on their con‐
tents after an error.
```
So if select call returns zero error should be returned in waitForInput.