]> git.saurik.com Git - redis.git/blobdiff - src/redis-cli.c
Version bumped to 2.5.10 (2.6 RC4) + Release Notes.
[redis.git] / src / redis-cli.c
index 1b3c0c7408627fbfb57fc8b0f585ff452b26e7df..f485587957dea102bda72243f4273dbae10702e4 100644 (file)
@@ -35,6 +35,7 @@
 #include <string.h>
 #include <stdlib.h>
 #include <unistd.h>
+#include <time.h>
 #include <ctype.h>
 #include <errno.h>
 #include <sys/stat.h>
@@ -1009,7 +1010,7 @@ static void pipeMode(void) {
             /* Read from socket and feed the hiredis reader. */
             do {
                 nread = read(fd,ibuf,sizeof(ibuf));
-                if (nread == -1 && errno != EAGAIN) {
+                if (nread == -1 && errno != EAGAIN && errno != EINTR) {
                     fprintf(stderr, "Error reading from the server: %s\n",
                         strerror(errno));
                     exit(1);
@@ -1052,7 +1053,7 @@ static void pipeMode(void) {
                     ssize_t nwritten = write(fd,obuf+obuf_pos,obuf_len);
                     
                     if (nwritten == -1) {
-                        if (errno != EAGAIN) {
+                        if (errno != EAGAIN && errno != EINTR) {
                             fprintf(stderr, "Error writing to the server: %s\n",
                                 strerror(errno));
                             exit(1);