Added test for FD_ISSET before reading fds