Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
eb67ca0f
Commit
eb67ca0f
authored
Oct 17, 2014
by
Matt Stancliff
Committed by
antirez
Oct 30, 2014
Browse files
redis-cli: ignore SIGPIPE network errors
Closes #2066
parent
bb9ad32c
Changes
1
Show whitespace changes
Inline
Side-by-side
src/redis-cli.c
View file @
eb67ca0f
...
@@ -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
;
...
@@ -1913,6 +1914,8 @@ int main(int argc, char **argv) {
...
@@ -1913,6 +1914,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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment