diff options
author | Matt Stancliff <matt@genges.com> | 2014-10-17 08:21:16 -0500 |
---|---|---|
committer | Matt Stancliff <matt@genges.com> | 2014-10-29 14:55:08 -0400 |
commit | e10c5444e79f8f6ce24112175dd42afb8d0b067a (patch) | |
tree | 15b87e1a900b27aa6cc53e1c766f63d036abc263 | |
parent | 6fbaeddf3f547217df9f808da80a716661bfa591 (diff) | |
download | redis-e10c5444e79f8f6ce24112175dd42afb8d0b067a.tar.gz |
redis-cli: ignore SIGPIPE network errors
Closes #2066
-rw-r--r-- | src/redis-cli.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/redis-cli.c b/src/redis-cli.c index 07bcf0a04..34070ab80 100644 --- a/src/redis-cli.c +++ b/src/redis-cli.c @@ -524,7 +524,8 @@ static int cliReadReply(int output_raw_strings) { } if (config.interactive) { /* Filter cases where we should reconnect */ - if (context->err == REDIS_ERR_IO && errno == ECONNRESET) + if (context->err == REDIS_ERR_IO && + (errno == ECONNRESET || errno == EPIPE)) return REDIS_ERR; if (context->err == REDIS_ERR_EOF) return REDIS_ERR; @@ -1914,6 +1915,8 @@ int main(int argc, char **argv) { argc -= firstarg; argv += firstarg; + signal(SIGPIPE, SIG_IGN); + /* Latency mode */ if (config.latency_mode) { if (cliConnect(0) == REDIS_ERR) exit(1); |