Once you reach the end of a file, it remains readable so that poll
will return immediately, and calling read
will immediately return zero. You need to handle this condition, perhaps by closing it and removing it from the set of polls, where you're currently printing Strange
.