From: Antonio Ognio Date: Fri, 19 Mar 2010 06:01:08 +0000 (-0500) Subject: Fixing issue 193 X-Git-Url: https://git.saurik.com/redis.git/commitdiff_plain/6bccf64a5e0cf2050da4809a5304bdf797c9d5cf Fixing issue 193 --- diff --git a/redis.c b/redis.c index 7c0a8695..72cdd256 100644 --- a/redis.c +++ b/redis.c @@ -1614,12 +1614,15 @@ static void loadServerConfig(char *filename) { char buf[REDIS_CONFIGLINE_MAX+1], *err = NULL; int linenum = 0; 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') fp = stdin; else { if ((fp = fopen(filename,"r")) == NULL) { - redisLog(REDIS_WARNING,"Fatal error, can't open config file"); + redisLog(REDIS_WARNING, errorbuf); exit(1); } }