Permalink
Browse files

redis-cli pipe mode: handle EINTR properly as well so that SIGSTOP/SI…

…GCONT are handled correctly.
  • Loading branch information...
antirez committed May 11, 2012
1 parent b074461 commit 47d8dab2b142a759a9a342a50454069f5cff3206
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/redis-cli.c
View
@@ -919,7 +919,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);
@@ -962,7 +962,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);

0 comments on commit 47d8dab

Please sign in to comment.