From: antirez Date: Fri, 27 Aug 2010 10:46:10 +0000 (+0200) Subject: Fixed another instace of the Issue 173 X-Git-Url: https://git.saurik.com/redis.git/commitdiff_plain/09252fc4f36e9a5b89c9a9ff8b3c9750a3144b45?ds=inline;hp=--cc Fixed another instace of the Issue 173 --- 09252fc4f36e9a5b89c9a9ff8b3c9750a3144b45 diff --git a/src/replication.c b/src/replication.c index 363ce54a..c2846088 100644 --- a/src/replication.c +++ b/src/replication.c @@ -138,7 +138,7 @@ int syncRead(int fd, char *ptr, ssize_t size, int timeout) { while(size) { if (aeWait(fd,AE_READABLE,1000) & AE_READABLE) { nread = read(fd,ptr,size); - if (nread == -1) return -1; + if (nread <= 0) return -1; ptr += nread; size -= nread; totread += nread;