Commit 2c42b645 authored by Salvatore Sanfilippo's avatar Salvatore Sanfilippo
Browse files

Merge pull request #2078 from mattsta/hiredis-sigpipe

Fix redis-cli from exiting after idle connection breaks
parents 6fbaeddf e10c5444
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment