Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
2f3c8609
Commit
2f3c8609
authored
Dec 09, 2014
by
Jan-Erik Rediger
Committed by
antirez
Dec 09, 2014
Browse files
Only ignore sigpipe in interactive mode
This allows shell pipes to correctly end redis-cli. Ref #2066
parent
0c211a19
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/redis-cli.c
View file @
2f3c8609
...
@@ -1915,8 +1915,6 @@ int main(int argc, char **argv) {
...
@@ -1915,8 +1915,6 @@ 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
);
...
@@ -1965,6 +1963,9 @@ int main(int argc, char **argv) {
...
@@ -1965,6 +1963,9 @@ int main(int argc, char **argv) {
/* Start interactive mode when no command is provided */
/* Start interactive mode when no command is provided */
if
(
argc
==
0
&&
!
config
.
eval
)
{
if
(
argc
==
0
&&
!
config
.
eval
)
{
/* Ignore SIGPIPE in interactive mode to force a reconnect */
signal
(
SIGPIPE
,
SIG_IGN
);
/* Note that in repl mode we don't abort on connection error.
/* Note that in repl mode we don't abort on connection error.
* A new attempt will be performed for every command send. */
* A new attempt will be performed for every command send. */
cliConnect
(
0
);
cliConnect
(
0
);
...
...
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