]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
stats: Add missing stats_startup_time global variable to unit tests
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Mon, 20 Apr 2020 08:44:03 +0000 (11:44 +0300)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Mon, 20 Apr 2020 08:53:54 +0000 (11:53 +0300)
It's not currently actually used, but this fixes linking
--without-shared-libs

src/stats/test-stats-common.c

index 7c94ff530a94a2b39b6e1841f4491b29cd48552a..3e307a9e586e3280d91729f44ecb98a873d2245b 100644 (file)
@@ -1,6 +1,7 @@
 /* Copyright (c) 2019 Dovecot authors, see the included COPYING file */
 
 #include "test-stats-common.h"
+#include <time.h>
 #include <unistd.h>
 
 struct event_category test_category = {
@@ -14,6 +15,7 @@ struct event_category child_test_category = {
 
 pool_t test_pool;
 struct stats_metrics *stats_metrics = NULL;
+time_t stats_startup_time;
 
 static bool callback_added = FALSE;
 
@@ -44,6 +46,7 @@ void test_init(const char *settings_blob)
 
        stats_event_categories_init();
        test_pool = pool_alloconly_create(MEMPOOL_GROWING"test pool", 2048);
+       stats_startup_time = time(NULL);
 
        /* register test categories */
        stats_event_category_register(test_category.name, NULL);