From: Valentine Krasnobaeva Date: Mon, 5 Aug 2024 08:04:03 +0000 (+0200) Subject: MINOR: startup: rename readcfgfile in parse_cfg X-Git-Tag: v3.1-dev5~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c6cfa7cb4acc850b480d6e1fd6f3ec74cf690546;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/addons/ot/src/parser.c b/addons/ot/src/parser.c index 74585b3f1e..0f8fc5495f 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 fb6eef261e..04c4ed94ae 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 4c3f764471..24c22f9cc4 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 9358283dac..1f3709b371 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 a4341dac6b..c607941ad3 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;