summaryrefslogtreecommitdiff
path: root/src/redis-cli.c
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2012-05-11 16:08:57 +0200
committerantirez <antirez@gmail.com>2012-05-11 16:08:57 +0200
commitea66be60802fea82d88d48e0af87d1e6c20bfee5 (patch)
tree73d6f3639e116b838ecb979f65c87599c901b388 /src/redis-cli.c
parentf6bd9122c0692bd76e7c1d90062c50551cd898a5 (diff)
downloadredis-ea66be60802fea82d88d48e0af87d1e6c20bfee5.tar.gz
redis-cli pipe mode: handle EINTR properly as well so that SIGSTOP/SIGCONT are handled correctly.
Diffstat (limited to 'src/redis-cli.c')
-rw-r--r--src/redis-cli.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/redis-cli.c b/src/redis-cli.c
index 1b3c0c740..ca2f06233 100644
--- a/src/redis-cli.c
+++ b/src/redis-cli.c
@@ -1009,7 +1009,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 +1052,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);