From 0d479e33a8ebe206dc5b62135f90880e54b6c117 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 17 Aug 2023 12:46:15 +0200 Subject: Merging upstream version 1.42.1. Signed-off-by: Daniel Baumann --- database/engine/rrdengineapi.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'database/engine/rrdengineapi.c') diff --git a/database/engine/rrdengineapi.c b/database/engine/rrdengineapi.c index 264cbdfeb..c6b1fa2dd 100755 --- a/database/engine/rrdengineapi.c +++ b/database/engine/rrdengineapi.c @@ -1014,7 +1014,12 @@ size_t rrdeng_disk_space_used(STORAGE_INSTANCE *db_instance) { time_t rrdeng_global_first_time_s(STORAGE_INSTANCE *db_instance) { struct rrdengine_instance *ctx = (struct rrdengine_instance *)db_instance; - return __atomic_load_n(&ctx->atomic.first_time_s, __ATOMIC_RELAXED); + + time_t t = __atomic_load_n(&ctx->atomic.first_time_s, __ATOMIC_RELAXED); + if(t == LONG_MAX || t < 0) + t = 0; + + return t; } size_t rrdeng_currently_collected_metrics(STORAGE_INSTANCE *db_instance) { -- cgit v1.2.3