Skip to content

Commit

Permalink
redis-cli pipe mode: handle EINTR properly as well so that SIGSTOP/SI…
Browse files Browse the repository at this point in the history
…GCONT are handled correctly.
  • Loading branch information
antirez committed May 11, 2012
1 parent f6bd912 commit ea66be6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/redis-cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit ea66be6

Please sign in to comment.