PerlRedis/perl-redis — pull request #75 by xtab (2014-02-01 19:57:18+00:00)
Title: __try_read_sock: also check errno if read returns 0

In some cases (and notably FreeBSD), a read() on a socket which doesn't
have data ready sets errno but returns 0. This confuses the library
into thinking that we hit an end-of-file because the server closed the
connection.

Therefore, we need to check errno even when read() returns 0; in
particular, EAGAIN means read() returned no data, but the socket is
still alive and should not be closed.