From: Willy Tarreau Date: Tue, 15 Dec 2009 20:46:25 +0000 (+0100) Subject: [MINOR] config: don't report error on all subsequent files on failure X-Git-Tag: v1.4-dev5~60 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=25a67fae3e2dd374c51c5e50633ea68b08157fab;p=thirdparty%2Fhaproxy.git [MINOR] config: don't report error on all subsequent files on failure Cyril Bonté found that when an error is detected in one config file, it is also reported in all other ones, which is wrong. The fix obviously consists in checking the return code from readcfgfile() and not the accumulator. --- diff --git a/src/haproxy.c b/src/haproxy.c index c5558ca40d..71537d02fd 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -549,9 +549,9 @@ void init(int argc, char **argv) cfg_cfgfile[i], strerror(errno)); exit(1); } - err_code |= ret; - if (err_code & (ERR_ABORT|ERR_FATAL)) + if (ret & (ERR_ABORT|ERR_FATAL)) Alert("Error(s) found in configuration file : %s\n", cfg_cfgfile[i]); + err_code |= ret; if (err_code & ERR_ABORT) exit(1); }