CLEANUP: config: Return ERR_NONE from config callbacks instead of 0

Return ERR_NONE instead of 0 on success for all config callbacks that should
return ERR_* codes. There is no change because ERR_NONE is a macro equals to
0. But this makes the return value more explicit.
This commit is contained in:
Christopher Faulet 2020-11-06 15:24:23 +01:00
parent 5214099233
commit fc633b6eff
12 changed files with 20 additions and 20 deletions

View File

@ -625,7 +625,7 @@ static int init_51degrees(void)
fiftyoneDegreesDataSetInitStatus _51d_dataset_status = DATA_SET_INIT_STATUS_NOT_SET;
if (!global_51degrees.data_file_path)
return 0;
return ERR_NONE;
if (global.nbthread < 1) {
ha_alert("51Degrees: The thread count cannot be zero or negative.\n");
@ -708,7 +708,7 @@ static int init_51degrees(void)
}
#endif
return 0;
return ERR_NONE;
}
static void deinit_51degrees(void)

View File

@ -1533,7 +1533,7 @@ int post_check_cache()
struct cache *back, *cache_config, *cache;
struct shared_context *shctx;
int ret_shctx;
int err_code = 0;
int err_code = ERR_NONE;
list_for_each_entry_safe(cache_config, back, &caches_config, list) {

View File

@ -1142,7 +1142,7 @@ static int start_checks()
}
if (!nbcheck)
return 0;
return ERR_NONE;
srand((unsigned)time(NULL));
@ -1180,7 +1180,7 @@ static int start_checks()
}
}
}
return 0;
return ERR_NONE;
}
@ -1227,7 +1227,7 @@ static int init_srv_check(struct server *srv)
{
const char *err;
struct tcpcheck_rule *r;
int ret = 0;
int ret = ERR_NONE;
int check_type;
if (!srv->do_check)
@ -1353,7 +1353,7 @@ static int init_srv_agent_check(struct server *srv)
{
struct tcpcheck_rule *chk;
const char *err;
int ret = 0;
int ret = ERR_NONE;
if (!srv->do_agent)
goto out;

View File

@ -119,7 +119,7 @@ static void da_haproxy_log(da_severity_t severity, da_status_t status,
*/
static int init_deviceatlas(void)
{
int err_code = 0;
int err_code = ERR_NONE;
if (global_deviceatlas.jsonpath != 0) {
FILE *jsonp;

View File

@ -894,7 +894,7 @@ static int init_debug()
sigemptyset(&sa.sa_mask);
sa.sa_flags = SA_SIGINFO;
sigaction(DEBUGSIG, &sa, NULL);
return 0;
return ERR_NONE;
}
REGISTER_POST_CHECK(init_debug);

View File

@ -288,7 +288,7 @@ static int
flt_init_all()
{
struct proxy *px;
int err_code = 0;
int err_code = ERR_NONE;
for (px = proxies_list; px; px = px->next) {
if (px->disabled) {

View File

@ -2005,7 +2005,7 @@ static int proxy_check_errors(struct proxy *px)
{
struct conf_errors *conf_err, *conf_err_back;
struct http_errors *http_errs;
int rc, err = 0;
int rc, err = ERR_NONE;
list_for_each_entry_safe(conf_err, conf_err_back, &px->conf.errors, list) {
if (conf_err->type == 1) {
@ -2061,7 +2061,7 @@ static int post_check_errors()
struct ebpt_node *node;
struct http_error_msg *http_errmsg;
struct htx *htx;
int err_code = 0;
int err_code = ERR_NONE;
node = ebpt_first(&http_error_messages);
while (node) {

View File

@ -972,7 +972,7 @@ int cfg_post_parse_ring()
*/
int post_sink_resolve()
{
int err_code = 0;
int err_code = ERR_NONE;
struct logsrv *logsrv, *logb;
struct sink *sink;
struct proxy *px;

View File

@ -612,7 +612,7 @@ static int ssl_sock_register_msg_callbacks(void)
}
#endif
return 0;
return ERR_NONE;
}
/* Used to free all SSL/TLS protocol message callbacks that were
@ -1245,7 +1245,7 @@ static int tlskeys_finalize_config(void)
/* swap root */
LIST_ADD(&tkr, &tlskeys_reference);
LIST_DEL(&tkr);
return 0;
return ERR_NONE;
}
#endif /* SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB */
@ -6306,7 +6306,7 @@ void ssl_free_global_issuers(void)
#ifndef OPENSSL_NO_ENGINE
static int ssl_check_async_engine_count(void) {
int err_code = 0;
int err_code = ERR_NONE;
if (global_ssl.async && (openssl_engines_initialized > 32)) {
ha_alert("ssl-mode-async only supports a maximum of 32 engines.\n");

View File

@ -3470,7 +3470,7 @@ static int check_proxy_tcpcheck(struct proxy *px)
struct tcpcheck_rule *chk, *back;
char *comment = NULL, *errmsg = NULL;
enum tcpcheck_rule_type prev_action = TCPCHK_ACT_COMMENT;
int ret = 0;
int ret = ERR_NONE;
if (!(px->cap & PR_CAP_BE) || (px->options2 & PR_O2_CHK_ANY) != PR_O2_TCPCHK_CHK) {
deinit_proxy_tcpcheck(px);

View File

@ -174,7 +174,7 @@ int init_wdt()
sigemptyset(&sa.sa_mask);
sa.sa_flags = SA_SIGINFO;
sigaction(WDTSIG, &sa, NULL);
return 0;
return ERR_NONE;
}
REGISTER_POST_CHECK(init_wdt);

View File

@ -263,7 +263,7 @@ static int ha_wurfl_init(void)
// wurfl-data-file not configured, WURFL is not used so don't try to
// configure it.
if (global_wurfl.data_file == NULL)
return 0;
return ERR_NONE;
ha_notice("WURFL: Loading module v.%s\n", HA_WURFL_MODULE_VERSION);
// creating WURFL handler
@ -395,7 +395,7 @@ static int ha_wurfl_init(void)
ha_notice("WURFL: Engine loaded\n");
ha_notice("WURFL: Module load completed\n");
return 0;
return ERR_NONE;
}
static void ha_wurfl_deinit(void)