summaryrefslogtreecommitdiffstats
path: root/database
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xdatabase/engine/rrdengineapi.c7
1 files changed, 6 insertions, 1 deletions
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) {