提交 a8f9cec1 编写于 作者: J Jan-Erik Rediger 提交者: antirez

Always exit if connection fails.

This avoids unnecessary core dumps. Fixes antirez/redis#894
上级 aadcda99
......@@ -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();
}
......@@ -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();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册