Skip to content

Commit

Permalink
Merge pull request #895 from badboy/catch_con_error
Browse files Browse the repository at this point in the history
redis-cli: always exit if connection fails.
  • Loading branch information
antirez committed Jan 19, 2013
2 parents 947f168 + 59046a7 commit 74f1373
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/redis-cli.c
Expand Up @@ -1288,19 +1288,19 @@ int main(int argc, char **argv) {

/* Latency mode */
if (config.latency_mode) {
cliConnect(0);
if (cliConnect(0) == REDIS_ERR) exit(1);
latencyMode();
}

/* Slave mode */
if (config.slave_mode) {
cliConnect(0);
if (cliConnect(0) == REDIS_ERR) exit(1);
slaveMode();
}

/* Get RDB mode. */
if (config.getrdb_mode) {
cliConnect(0);
if (cliConnect(0) == REDIS_ERR) exit(1);
getRDB();
}

Expand All @@ -1312,7 +1312,7 @@ int main(int argc, char **argv) {

/* Find big keys */
if (config.bigkeys) {
cliConnect(0);
if (cliConnect(0) == REDIS_ERR) exit(1);
findBigKeys();
}

Expand Down

0 comments on commit 74f1373

Please sign in to comment.