From 2192b2830337c5420f58a689271de0e5adbca710 Mon Sep 17 00:00:00 2001 From: James Hogarth Date: Fri, 17 Apr 2015 23:40:57 +0100 Subject: [PATCH] Check line number of error so that this works with libconfig-1.3.2 in CentOS6 --- sslh-main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sslh-main.c b/sslh-main.c index 9cc8a06..607b44f 100644 --- a/sslh-main.c +++ b/sslh-main.c @@ -280,7 +280,10 @@ static int config_parse(char *filename, struct addrinfo **listen, struct proto * config_init(&config); if (config_read_file(&config, filename) == CONFIG_FALSE) { - if (config_error_type(&config) == CONFIG_ERR_PARSE) { +/* 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),