提交 e8f7899a 编写于 作者: M Matt Stancliff 提交者: antirez

redis-cli: ignore SIGPIPE network errors

Closes #2066
上级 2480315f
...@@ -524,7 +524,8 @@ static int cliReadReply(int output_raw_strings) { ...@@ -524,7 +524,8 @@ static int cliReadReply(int output_raw_strings) {
} }
if (config.interactive) { if (config.interactive) {
/* Filter cases where we should reconnect */ /* 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; return REDIS_ERR;
if (context->err == REDIS_ERR_EOF) if (context->err == REDIS_ERR_EOF)
return REDIS_ERR; return REDIS_ERR;
...@@ -1914,6 +1915,8 @@ int main(int argc, char **argv) { ...@@ -1914,6 +1915,8 @@ int main(int argc, char **argv) {
argc -= firstarg; argc -= firstarg;
argv += firstarg; argv += firstarg;
signal(SIGPIPE, SIG_IGN);
/* Latency mode */ /* Latency mode */
if (config.latency_mode) { if (config.latency_mode) {
if (cliConnect(0) == REDIS_ERR) exit(1); if (cliConnect(0) == REDIS_ERR) exit(1);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册