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.
diff --git a/src/51d.c b/src/51d.c
index 483a17b..31d7c3f 100644
--- a/src/51d.c
+++ b/src/51d.c
@@ -625,7 +625,7 @@
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 @@
}
#endif
- return 0;
+ return ERR_NONE;
}
static void deinit_51degrees(void)
diff --git a/src/cache.c b/src/cache.c
index 4f8fad9..bd77a6c 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -1533,7 +1533,7 @@
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) {
diff --git a/src/check.c b/src/check.c
index 63869b9..315bc87 100644
--- a/src/check.c
+++ b/src/check.c
@@ -1142,7 +1142,7 @@
}
if (!nbcheck)
- return 0;
+ return ERR_NONE;
srand((unsigned)time(NULL));
@@ -1180,7 +1180,7 @@
}
}
}
- return 0;
+ return ERR_NONE;
}
@@ -1227,7 +1227,7 @@
{
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 @@
{
struct tcpcheck_rule *chk;
const char *err;
- int ret = 0;
+ int ret = ERR_NONE;
if (!srv->do_agent)
goto out;
diff --git a/src/da.c b/src/da.c
index 98dbe6c..c11e076 100644
--- a/src/da.c
+++ b/src/da.c
@@ -119,7 +119,7 @@
*/
static int init_deviceatlas(void)
{
- int err_code = 0;
+ int err_code = ERR_NONE;
if (global_deviceatlas.jsonpath != 0) {
FILE *jsonp;
diff --git a/src/debug.c b/src/debug.c
index b2a4c6b..7f2d167 100644
--- a/src/debug.c
+++ b/src/debug.c
@@ -894,7 +894,7 @@
sigemptyset(&sa.sa_mask);
sa.sa_flags = SA_SIGINFO;
sigaction(DEBUGSIG, &sa, NULL);
- return 0;
+ return ERR_NONE;
}
REGISTER_POST_CHECK(init_debug);
diff --git a/src/filters.c b/src/filters.c
index d18f773..1b954d8 100644
--- a/src/filters.c
+++ b/src/filters.c
@@ -288,7 +288,7 @@
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) {
diff --git a/src/http_htx.c b/src/http_htx.c
index d3c3f42..b27b083 100644
--- a/src/http_htx.c
+++ b/src/http_htx.c
@@ -2005,7 +2005,7 @@
{
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 @@
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) {
diff --git a/src/sink.c b/src/sink.c
index b87ea28..09a3026 100644
--- a/src/sink.c
+++ b/src/sink.c
@@ -972,7 +972,7 @@
*/
int post_sink_resolve()
{
- int err_code = 0;
+ int err_code = ERR_NONE;
struct logsrv *logsrv, *logb;
struct sink *sink;
struct proxy *px;
diff --git a/src/ssl_sock.c b/src/ssl_sock.c
index 9072752..39a00d8 100644
--- a/src/ssl_sock.c
+++ b/src/ssl_sock.c
@@ -612,7 +612,7 @@
}
#endif
- return 0;
+ return ERR_NONE;
}
/* Used to free all SSL/TLS protocol message callbacks that were
@@ -1245,7 +1245,7 @@
/* 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 @@
#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");
diff --git a/src/tcpcheck.c b/src/tcpcheck.c
index 75d97f3..3ecb0ba 100644
--- a/src/tcpcheck.c
+++ b/src/tcpcheck.c
@@ -3470,7 +3470,7 @@
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);
diff --git a/src/wdt.c b/src/wdt.c
index d6a3e56..18836ff 100644
--- a/src/wdt.c
+++ b/src/wdt.c
@@ -174,7 +174,7 @@
sigemptyset(&sa.sa_mask);
sa.sa_flags = SA_SIGINFO;
sigaction(WDTSIG, &sa, NULL);
- return 0;
+ return ERR_NONE;
}
REGISTER_POST_CHECK(init_wdt);
diff --git a/src/wurfl.c b/src/wurfl.c
index 06029aa..34075d6 100644
--- a/src/wurfl.c
+++ b/src/wurfl.c
@@ -263,7 +263,7 @@
// 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 @@
ha_notice("WURFL: Engine loaded\n");
ha_notice("WURFL: Module load completed\n");
- return 0;
+ return ERR_NONE;
}
static void ha_wurfl_deinit(void)