MINOR: init: report in "haproxy -c" whether there were warnings or not
This helps quickly checking if the config produces any warning. For
this we reuse the "warned" bit field to add a new WARN_ANY bit that is
set by ha_warning(). The rest of the bit field was also cleaned from
unused bits.
diff --git a/src/haproxy.c b/src/haproxy.c
index 278476c..359b970 100644
--- a/src/haproxy.c
+++ b/src/haproxy.c
@@ -2101,6 +2101,9 @@
struct peers *pr;
struct proxy *px;
+ if (warned & WARN_ANY)
+ qfprintf(stdout, "Warnings were found.\n");
+
for (pr = cfg_peers; pr; pr = pr->next)
if (pr->peers_fe)
break;
diff --git a/src/log.c b/src/log.c
index 2cac074..50b5080 100644
--- a/src/log.c
+++ b/src/log.c
@@ -1123,6 +1123,8 @@
{
va_list argp;
+ warned |= WARN_ANY;
+
if (!(global.mode & MODE_QUIET) || (global.mode & MODE_VERBOSE)) {
va_start(argp, fmt);
print_message("WARNING", fmt, argp);