From e3a93ff814e773aa857d9d9e4bae96eca0288e24 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Tue, 15 Dec 2009 21:46:25 +0100 Subject: [PATCH] [MINOR] config: don't report error on all subsequent files on failure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. (cherry picked from commit 25a67fae3e2dd374c51c5e50633ea68b08157fab) --- src/haproxy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/haproxy.c b/src/haproxy.c index a7b09898d9..d7a6875a52 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -551,9 +551,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); }