[Aggregator] Handle confuse errors as in listener
This commit is contained in:
parent
4117e8dc14
commit
7f262a8573
|
@ -115,8 +115,17 @@ void parse_config_file(int argc, char **argv)
|
||||||
|
|
||||||
/* Parse config file */
|
/* Parse config file */
|
||||||
cfg = cfg_init(opts, CFGF_NONE) ; // Initialise options
|
cfg = cfg_init(opts, CFGF_NONE) ; // Initialise options
|
||||||
if (cfg_parse(cfg, config_file) == CFG_PARSE_ERROR)
|
switch (cfg_parse(cfg, config_file))
|
||||||
{
|
{
|
||||||
|
case CFG_FILE_ERROR :
|
||||||
|
fprintf(stderr,
|
||||||
|
"Error! Cannot open configuration file « %s »: %s.\n",
|
||||||
|
config_file, strerror(errno)) ;
|
||||||
|
break ;
|
||||||
|
case CFG_PARSE_ERROR :
|
||||||
|
fprintf(stderr,
|
||||||
|
"Error! Parsing of configuration file « %s » failed!\n",
|
||||||
|
config_file) ;
|
||||||
free(config_file) ;
|
free(config_file) ;
|
||||||
exit(ERR_PARSING_CONFIG_FILE) ;
|
exit(ERR_PARSING_CONFIG_FILE) ;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue