]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: diag: always show the version before dumping a diag warning
authorWilly Tarreau <w@1wt.eu>
Sat, 3 Feb 2024 11:01:58 +0000 (12:01 +0100)
committerWilly Tarreau <w@1wt.eu>
Sat, 3 Feb 2024 11:08:11 +0000 (12:08 +0100)
Diag warnings were added in 2.4 by commit 7b01a8dbd ("MINOR: global:
define diagnostic mode of execution") but probably due to the split
function that checks for the mode, they did not reuse the emission of
the version string before the first warning, as was brought in 2.2 by
commit bebd21206 ("MINOR: init: report in "haproxy -c" whether there
were warnings or not"). The effet is that diag warnings are emitted
before the version string if there is no other warning nor error. Let's
just proceed like for the two other ones.

This can be backported to 2.4, though this is of very low importance.

src/errors.c

index e30f21ef28e4b43daa5281f59a57ab0acd8d6094..7a2d14a153e4d6766982ef88f79c614b19670a75 100644 (file)
@@ -472,6 +472,10 @@ void ha_warning(const char *fmt, ...)
  */
 void _ha_vdiag_warning(const char *fmt, va_list argp)
 {
+       warned |= WARN_ANY;
+       HA_ATOMIC_INC(&tot_warnings);
+
+       warn_exec_path();
        print_message(1, "DIAG", fmt, argp);
 }