提交 6bccf64a 编写于 作者: A Antonio Ognio

Fixing issue 193

上级 c77169b7
...@@ -1614,12 +1614,15 @@ static void loadServerConfig(char *filename) { ...@@ -1614,12 +1614,15 @@ static void loadServerConfig(char *filename) {
char buf[REDIS_CONFIGLINE_MAX+1], *err = NULL; char buf[REDIS_CONFIGLINE_MAX+1], *err = NULL;
int linenum = 0; int linenum = 0;
sds line = NULL; sds line = NULL;
char *errormsg = "Fatal error, can't open config file '%s'";
char *errorbuf = zmalloc(sizeof(char)*(strlen(errormsg)+strlen(filename)));
sprintf(errorbuf, errormsg, filename);
if (filename[0] == '-' && filename[1] == '\0') if (filename[0] == '-' && filename[1] == '\0')
fp = stdin; fp = stdin;
else { else {
if ((fp = fopen(filename,"r")) == NULL) { if ((fp = fopen(filename,"r")) == NULL) {
redisLog(REDIS_WARNING,"Fatal error, can't open config file"); redisLog(REDIS_WARNING, errorbuf);
exit(1); exit(1);
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册