]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: debug: remove the trailing \n from BUG_ON() statements
authorWilly Tarreau <w@1wt.eu>
Mon, 14 Apr 2025 16:45:35 +0000 (18:45 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 14 Apr 2025 17:02:13 +0000 (19:02 +0200)
These ones were added by mistake during the change of the cfgparse
mechanism in 3.1, but they're corrupting the output of "debug counters"
by leaving stray ']' on their own lines. We could possibly check them
all once at boot but it doens't seem worth it.

This should be backported to 3.1.

src/cfgparse-global.c
src/cli.c
src/mworker.c
src/tools.c

index ba69ed1af2dc9b184e29003427300b9417ba4de8..caf89df75428f3871f486758834cd3407e7a09c5 100644 (file)
@@ -983,7 +983,7 @@ static int cfg_parse_global_mode(char **args, int section_type,
                global.mode |= MODE_ZERO_WARNING;
 
        } else {
-               BUG_ON(1, "Triggered in cfg_parse_global_mode() by unsupported keyword.\n");
+               BUG_ON(1, "Triggered in cfg_parse_global_mode() by unsupported keyword.");
                return -1;
        }
 
@@ -1014,7 +1014,7 @@ static int cfg_parse_global_disable_poller(char **args, int section_type,
                global.tune.options &= ~GTUNE_USE_POLL;
 
        } else {
-               BUG_ON(1, "Triggered in cfg_parse_global_disable_poller() by unsupported keyword.\n");
+               BUG_ON(1, "Triggered in cfg_parse_global_disable_poller() by unsupported keyword.");
                return -1;
        }
 
@@ -1042,7 +1042,7 @@ static int cfg_parse_global_pidfile(char **args, int section_type,
                }
                global.pidfile = strdup(args[1]);
        } else {
-               BUG_ON(1, "Triggered in cfg_parse_global_pidfile() by unsupported keyword.\n");
+               BUG_ON(1, "Triggered in cfg_parse_global_pidfile() by unsupported keyword.");
                return -1;
        }
 
@@ -1062,7 +1062,7 @@ static int cfg_parse_global_non_std_directives(char **args, int section_type,
        } else if (strcmp(args[0], "expose-experimental-directives") == 0) {
                experimental_directives_allowed = 1;
        } else {
-               BUG_ON(1, "Triggered in cfg_parse_global_non_std_directives() by unsupported keyword.\n");
+               BUG_ON(1, "Triggered in cfg_parse_global_non_std_directives() by unsupported keyword.");
                return -1;
        }
 
@@ -1365,7 +1365,7 @@ static int cfg_parse_global_tune_opts(char **args, int section_type,
                }
        }
        else {
-               BUG_ON(1, "Triggered in cfg_parse_global_tune_opts() by unsupported keyword.\n");
+               BUG_ON(1, "Triggered in cfg_parse_global_tune_opts() by unsupported keyword.");
                return -1;
        }
 
@@ -1398,7 +1398,7 @@ static int cfg_parse_global_tune_forward_opts(char **args, int section_type,
                global.tune.no_zero_copy_fwd |= NO_ZERO_COPY_FWD;
        }
        else {
-               BUG_ON(1, "Triggered in cfg_parse_global_tune_forward_opts() by unsupported keyword.\n");
+               BUG_ON(1, "Triggered in cfg_parse_global_tune_forward_opts() by unsupported keyword.");
                return -1;
        }
 
@@ -1418,7 +1418,7 @@ static int cfg_parse_global_unsupported_opts(char **args, int section_type,
                memprintf(err, "option '%s' is not supported any more (tune.bufsize is used instead).", args[0]);
        }
        else {
-               BUG_ON(1, "Triggered in cfg_parse_global_unsupported_opts() by unsupported keyword.\n");
+               BUG_ON(1, "Triggered in cfg_parse_global_unsupported_opts() by unsupported keyword.");
        }
 
        return -1;
@@ -1501,7 +1501,7 @@ static int cfg_parse_global_env_opts(char **args, int section_type,
                }
        }
        else {
-               BUG_ON(1, "Triggered in cfg_parse_global_env_opts() by unsupported keyword.\n");
+               BUG_ON(1, "Triggered in cfg_parse_global_env_opts() by unsupported keyword.");
                return -1;
        }
 
@@ -1592,7 +1592,7 @@ static int cfg_parse_tune_renice(char **args, int section_type, struct proxy *cu
                }
 
        } else {
-               BUG_ON(1, "Triggered in cfg_parse_tune_renice() by unsupported keyword.\n");
+               BUG_ON(1, "Triggered in cfg_parse_tune_renice() by unsupported keyword.");
        }
 
        return 0;
index 28619dd470ae6ccb5e0a9a1ffe5abe0d4b876137..f06f3c907e90134247aa078076679b182bbe6293 100644 (file)
--- a/src/cli.c
+++ b/src/cli.c
@@ -2514,7 +2514,7 @@ static int _send_status(char **args, char *payload, struct appctx *appctx, void
        int pid;
 
        BUG_ON((strcmp(args[0], "_send_status") != 0),
-               "Triggered in _send_status by unsupported command name.\n");
+               "Triggered in _send_status by unsupported command name.");
 
        pid = atoi(args[2]);
 
@@ -3530,7 +3530,7 @@ int mworker_cli_attach_server(char **errmsg)
        struct mworker_proc *child;
 
        BUG_ON((mworker_proxy == NULL), "Triggered in mworker_cli_attach_server(), "
-               "mworker_proxy must be created before this call.\n");
+               "mworker_proxy must be created before this call.");
 
        /* create all servers using the mworker_proc list */
        list_for_each_entry(child, &proc_list, list) {
index 68dd0f8762696dcc3fc469101b566b6a1b26b777..7cbe9ff6d2f6f884776b2b91e8cc88b436c048ea 100644 (file)
@@ -1043,7 +1043,7 @@ static int mworker_parse_global_max_reloads(char **args, int section_type, struc
                        return -1;
                }
        } else {
-               BUG_ON(1, "Triggered in mworker_parse_global_max_reloads() by unsupported keyword.\n");
+               BUG_ON(1, "Triggered in mworker_parse_global_max_reloads() by unsupported keyword.");
                return -1;
        }
 
index eec6bac896ef5fbc17de949d0fd56b9222a6e365..86135f6a81f2e41105ba5e1733035fdd500ef812 100644 (file)
@@ -7120,7 +7120,7 @@ int restore_env(void)
        char *value;
 
        BUG_ON(!init_env, "Triggered in restore_env(): must be preceded by "
-              "backup_env(), which allocates init_env.\n");
+              "backup_env(), which allocates init_env.");
 
        while (*env) {
                pos = strchr(*env, '=');