]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: debug: prepare complain() to be used in multiple ways
authorWilly Tarreau <w@1wt.eu>
Tue, 11 Aug 2026 09:13:14 +0000 (11:13 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 13 Aug 2026 15:43:30 +0000 (17:43 +0200)
We'll intrument the function to do a bit more, but all call paths will
not be able to support this, so let's first turn it to a general one
as _complain() and have complain() just call it. Better not inline them,
we don't want to duplicate the footprint for something rarely used.

src/debug.c

index f49c94e0088023ab770997dd44562e349e6892eb..56da25d2976d1ac7297deef84b7b19aedaf9a0e4 100644 (file)
@@ -973,7 +973,7 @@ void ha_stuck_warning(void)
  * follows is a new line that will be appended after another LF (normally it's
  * used to give extra info to the user about the issue's location).
  */
-void complain(uint details, const char *msg)
+static void _complain(uint details, const char *msg)
 {
        struct iovec iovec[10];
        const char *pfx;
@@ -1056,6 +1056,12 @@ void complain(uint details, const char *msg)
                mark_tainted(TAINTED_WARN);
 }
 
+/* the exported function */
+void complain(uint details, const char *msg)
+{
+       _complain(details, msg);
+}
+
 /* parse a "debug dev exit" command. It always returns 1, though it should never return. */
 static int debug_parse_cli_exit(char **args, char *payload, struct appctx *appctx, void *private)
 {