From 5886bd2d43db3ee6a9ae58e3e47c34e07cf80f00 Mon Sep 17 00:00:00 2001 From: Yves Rutschle Date: Thu, 16 Jul 2015 17:43:05 +0200 Subject: [PATCH] Print error message upon non-existent configuration file --- sslh-main.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/sslh-main.c b/sslh-main.c index 2029856..6936b47 100644 --- a/sslh-main.c +++ b/sslh-main.c @@ -287,17 +287,14 @@ static int config_parse(char *filename, struct addrinfo **listen, struct proto * config_init(&config); if (config_read_file(&config, filename) == CONFIG_FALSE) { -/* If it's a parse error then there will be a line number for the failure - * an I/O error (such as non-existent file) will have the error line as 0 - */ - if (config_error_line(&config) != 0) { - fprintf(stderr, "%s:%d:%s\n", - filename, - config_error_line(&config), - config_error_text(&config)); - exit(1); - } - return 1; + /* If it's a parse error then there will be a line number for the failure + * an I/O error (such as non-existent file) will have the error line as 0 + */ + fprintf(stderr, "%s:%d:%s\n", + filename, + config_error_line(&config), + config_error_text(&config)); + exit(1); } config_lookup_bool(&config, "verbose", &verbose);