]> git.saurik.com Git - redis.git/commitdiff
redis-cli pipe mode: handle EAGAIN while writing to socket.
authorantirez <antirez@gmail.com>
Fri, 11 May 2012 08:45:12 +0000 (10:45 +0200)
committerantirez <antirez@gmail.com>
Sat, 12 May 2012 07:33:11 +0000 (09:33 +0200)
src/redis-cli.c

index 1603c2d008bb1a513b15fec749f17fe4141fe6ae..1b3c0c7408627fbfb57fc8b0f585ff452b26e7df 100644 (file)
@@ -1052,9 +1052,13 @@ static void pipeMode(void) {
                     ssize_t nwritten = write(fd,obuf+obuf_pos,obuf_len);
                     
                     if (nwritten == -1) {
-                        fprintf(stderr, "Error writing to the server: %s\n",
-                            strerror(errno));
-                        exit(1);
+                        if (errno != EAGAIN) {
+                            fprintf(stderr, "Error writing to the server: %s\n",
+                                strerror(errno));
+                            exit(1);
+                        } else {
+                            nwritten = 0;
+                        }
                     }
                     obuf_len -= nwritten;
                     obuf_pos += nwritten;