From c6cfa7cb4acc850b480d6e1fd6f3ec74cf690546 Mon Sep 17 00:00:00 2001 From: Valentine Krasnobaeva Date: Mon, 5 Aug 2024 10:04:03 +0200 Subject: [PATCH] MINOR: startup: rename readcfgfile in parse_cfg As readcfgfile no longer opens configuration files and reads them with fgets, but performs only the parsing of provided data, let's rename it to parse_cfg by analogy with read_cfg in haproxy.c. --- addons/ot/src/parser.c | 2 +- include/haproxy/cfgparse.h | 2 +- src/cfgparse.c | 2 +- src/flt_spoe.c | 2 +- src/haproxy.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/ot/src/parser.c b/addons/ot/src/parser.c index 74585b3f1..0f8fc5495 100644 --- a/addons/ot/src/parser.c +++ b/addons/ot/src/parser.c @@ -1102,7 +1102,7 @@ static int flt_ot_parse_cfg(struct flt_ot_conf *conf, const char *flt_name, char ha_free(&cfg_file.content); FLT_OT_RETURN_INT(retval); } - retval = readcfgfile(&cfg_file); + retval = parse_cfg(&cfg_file); ha_free(&cfg_file.content); } diff --git a/include/haproxy/cfgparse.h b/include/haproxy/cfgparse.h index fb6eef261..04c4ed94a 100644 --- a/include/haproxy/cfgparse.h +++ b/include/haproxy/cfgparse.h @@ -112,7 +112,7 @@ int cfg_parse_global(const char *file, int linenum, char **args, int inv); int cfg_parse_listen(const char *file, int linenum, char **args, int inv); int cfg_parse_track_sc_num(unsigned int *track_sc_num, const char *arg, const char *end, char **err); -int readcfgfile(const struct cfgfile *cfg); +int parse_cfg(const struct cfgfile *cfg); void cfg_register_keywords(struct cfg_kw_list *kwl); void cfg_unregister_keywords(struct cfg_kw_list *kwl); int check_config_validity(void); diff --git a/src/cfgparse.c b/src/cfgparse.c index 4c3f76447..24c22f9cc 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -1826,7 +1826,7 @@ free_mem: * Only the two first ones can stop processing, the two others are just * indicators. */ -int readcfgfile(const struct cfgfile *cfg) +int parse_cfg(const struct cfgfile *cfg) { char *thisline = NULL; int linesize = LINESIZE; diff --git a/src/flt_spoe.c b/src/flt_spoe.c index 9358283da..1f3709b37 100644 --- a/src/flt_spoe.c +++ b/src/flt_spoe.c @@ -2272,7 +2272,7 @@ static int parse_spoe_flt(char **args, int *cur_arg, struct proxy *px, if (cfg_file.size < 0) { goto error; } - ret = readcfgfile(&cfg_file); + ret = parse_cfg(&cfg_file); ha_free(&cfg_file.content); /* unregister SPOE sections and restore previous sections */ diff --git a/src/haproxy.c b/src/haproxy.c index a4341dac6..c607941ad 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -1206,7 +1206,7 @@ static int read_cfg(char *progname) goto err; } - ret = readcfgfile(cfg); + ret = parse_cfg(cfg); if (ret == -1) goto err;