From: Stephan Bosch Date: Thu, 14 Nov 2019 23:08:15 +0000 (+0100) Subject: stats: Make settings available as a global variable. X-Git-Tag: 2.3.11.2~318 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=aee92828f73a88aeb9d479b6c2f36b1a16c449d8;p=thirdparty%2Fdovecot%2Fcore.git stats: Make settings available as a global variable. --- diff --git a/src/stats/main.c b/src/stats/main.c index 13d6f61cf8..7d84524997 100644 --- a/src/stats/main.c +++ b/src/stats/main.c @@ -10,6 +10,8 @@ #include "client-writer.h" #include "client-reader.h" +const struct stats_settings *stats_settings; + static struct stats_metrics *metrics; static bool client_is_writer(const char *path) @@ -54,9 +56,10 @@ static void main_preinit(void) static void main_init(void) { void **sets = master_service_settings_get_others(master_service); - const struct stats_settings *set = sets[0]; - metrics = stats_metrics_init(set); + stats_settings = sets[0]; + + metrics = stats_metrics_init(stats_settings); stats_event_categories_init(); client_readers_init(); client_writers_init(); diff --git a/src/stats/stats-common.h b/src/stats/stats-common.h index 4a0ff5558e..5f833bbd52 100644 --- a/src/stats/stats-common.h +++ b/src/stats/stats-common.h @@ -2,5 +2,8 @@ #define STATS_COMMON_H #include "lib.h" +#include "stats-settings.h" + +extern const struct stats_settings *stats_settings; #endif