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
a57d9cc4
Commit
a57d9cc4
authored
May 14, 2010
by
Bruno Deferrari
Browse files
If command is a shutdown, ignore errors on reply
parent
ba798261
Changes
1
Hide whitespace changes
Inline
Side-by-side
redis-cli.c
View file @
a57d9cc4
...
@@ -356,6 +356,7 @@ static int selectDb(int fd) {
...
@@ -356,6 +356,7 @@ static int selectDb(int fd) {
static
int
cliSendCommand
(
int
argc
,
char
**
argv
,
int
repeat
)
{
static
int
cliSendCommand
(
int
argc
,
char
**
argv
,
int
repeat
)
{
struct
redisCommand
*
rc
=
lookupCommand
(
argv
[
0
]);
struct
redisCommand
*
rc
=
lookupCommand
(
argv
[
0
]);
int
shutdown
=
0
;
int
fd
,
j
,
retval
=
0
;
int
fd
,
j
,
retval
=
0
;
sds
cmd
;
sds
cmd
;
...
@@ -370,6 +371,8 @@ static int cliSendCommand(int argc, char **argv, int repeat) {
...
@@ -370,6 +371,8 @@ static int cliSendCommand(int argc, char **argv, int repeat) {
fprintf
(
stderr
,
"Wrong number of arguments for '%s'
\n
"
,
rc
->
name
);
fprintf
(
stderr
,
"Wrong number of arguments for '%s'
\n
"
,
rc
->
name
);
return
1
;
return
1
;
}
}
if
(
!
strcasecmp
(
rc
->
name
,
"shutdown"
))
shutdown
=
1
;
if
(
!
strcasecmp
(
rc
->
name
,
"monitor"
))
config
.
monitor_mode
=
1
;
if
(
!
strcasecmp
(
rc
->
name
,
"monitor"
))
config
.
monitor_mode
=
1
;
if
(
!
strcasecmp
(
rc
->
name
,
"subscribe"
)
||
if
(
!
strcasecmp
(
rc
->
name
,
"subscribe"
)
||
!
strcasecmp
(
rc
->
name
,
"psubscribe"
))
config
.
pubsub_mode
=
1
;
!
strcasecmp
(
rc
->
name
,
"psubscribe"
))
config
.
pubsub_mode
=
1
;
...
@@ -408,7 +411,7 @@ static int cliSendCommand(int argc, char **argv, int repeat) {
...
@@ -408,7 +411,7 @@ static int cliSendCommand(int argc, char **argv, int repeat) {
retval
=
cliReadReply
(
fd
);
retval
=
cliReadReply
(
fd
);
if
(
retval
)
{
if
(
retval
)
{
return
retval
;
return
shutdown
?
0
:
retval
;
}
}
}
}
return
0
;
return
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