summaryrefslogtreecommitdiffstats
path: root/database/engine/rrdengineapi.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-08-17 10:46:15 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-08-17 10:46:15 +0000
commit0d479e33a8ebe206dc5b62135f90880e54b6c117 (patch)
tree272c5ddc92ae1e568e6df554e94894ee66a2dfd1 /database/engine/rrdengineapi.c
parentReleasing debian version 1.42.0-1. (diff)
downloadnetdata-0d479e33a8ebe206dc5b62135f90880e54b6c117.tar.xz
netdata-0d479e33a8ebe206dc5b62135f90880e54b6c117.zip
Merging upstream version 1.42.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'database/engine/rrdengineapi.c')
-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) {