]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[MINOR] config: don't report error on all subsequent files on failure
authorWilly Tarreau <w@1wt.eu>
Tue, 15 Dec 2009 20:46:25 +0000 (21:46 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 15 Dec 2009 20:50:18 +0000 (21:50 +0100)
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

index a7b09898d98fe6623a9b76f368f9cc811888246b..d7a6875a528f73c5d310bf02f2c32cc371ceb2cd 100644 (file)
@@ -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);
        }