From 7f262a85733055b048d704e07d754f3d6c6c347a Mon Sep 17 00:00:00 2001 From: Matteo Cypriani Date: Tue, 13 Jul 2010 14:36:28 +0200 Subject: [PATCH] [Aggregator] Handle confuse errors as in listener --- .../owlps-aggregator/owlps-aggregatord.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/infrastructure-centred/owlps-aggregator/owlps-aggregatord.c b/infrastructure-centred/owlps-aggregator/owlps-aggregatord.c index 20b0ac6..b806aac 100644 --- a/infrastructure-centred/owlps-aggregator/owlps-aggregatord.c +++ b/infrastructure-centred/owlps-aggregator/owlps-aggregatord.c @@ -115,8 +115,17 @@ void parse_config_file(int argc, char **argv) /* Parse config file */ 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) ; exit(ERR_PARSING_CONFIG_FILE) ; }