diff options
Diffstat (limited to 'net.c')
-rw-r--r-- | net.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -65,9 +65,9 @@ void redisNetClose(redisContext *c) { } int redisNetRead(redisContext *c, char *buf, size_t bufcap) { - int nread = read(c->fd, buf, bufcap); + int nread = recv(c->fd, buf, bufcap, 0); if (nread == -1) { - if ((errno == EAGAIN && !(c->flags & REDIS_BLOCK)) || (errno == EINTR)) { + if ((errno == EWOULDBLOCK && !(c->flags & REDIS_BLOCK)) || (errno == EINTR)) { /* Try again later */ return 0; } else { @@ -83,9 +83,9 @@ int redisNetRead(redisContext *c, char *buf, size_t bufcap) { } int redisNetWrite(redisContext *c) { - int nwritten = write(c->fd, c->obuf, sdslen(c->obuf)); + int nwritten = send(c->fd, c->obuf, sdslen(c->obuf), 0); if (nwritten < 0) { - if ((errno == EAGAIN && !(c->flags & REDIS_BLOCK)) || (errno == EINTR)) { + if ((errno == EWOULDBLOCK && !(c->flags & REDIS_BLOCK)) || (errno == EINTR)) { /* Try again later */ } else { __redisSetError(c, REDIS_ERR_IO, NULL); |