diff options
author | Stelios Fragkakis <52996999+stelfrag@users.noreply.github.com> | 2023-12-12 16:28:02 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-12 16:28:02 +0200 |
commit | 21462af834abcdf136c53d21379e74b2c7306839 (patch) | |
tree | 055a89b5ea74f8e0807acb58492cbb57370d896f /database/engine/pdc.c | |
parent | fbec21e40ddf621db74daf90daf5c76672955fc8 (diff) |
Handle coverity issues related to Y2K38_SAFETY (#16583)
* Switch update_every_s to uint32_t
Fix coverity issues related to Y2K38_SAFETY
* Fix CI
Diffstat (limited to 'database/engine/pdc.c')
-rw-r--r-- | database/engine/pdc.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/database/engine/pdc.c b/database/engine/pdc.c index 5fe205e645..58d421a383 100644 --- a/database/engine/pdc.c +++ b/database/engine/pdc.c @@ -628,7 +628,7 @@ void collect_page_flags_to_buffer(BUFFER *wb, RRDENG_COLLECT_PAGE_FLAGS flags) { buffer_strcat(wb, "STEP_UNALIGNED"); } -inline VALIDATED_PAGE_DESCRIPTOR validate_extent_page_descr(const struct rrdeng_extent_page_descr *descr, time_t now_s, time_t overwrite_zero_update_every_s, bool have_read_error) { +inline VALIDATED_PAGE_DESCRIPTOR validate_extent_page_descr(const struct rrdeng_extent_page_descr *descr, time_t now_s, uint32_t overwrite_zero_update_every_s, bool have_read_error) { time_t start_time_s = (time_t) (descr->start_time_ut / USEC_PER_SEC); time_t end_time_s; @@ -666,12 +666,12 @@ VALIDATED_PAGE_DESCRIPTOR validate_page( uuid_t *uuid, time_t start_time_s, time_t end_time_s, - time_t update_every_s, // can be zero, if unknown + uint32_t update_every_s, // can be zero, if unknown size_t page_length, uint8_t page_type, size_t entries, // can be zero, if unknown time_t now_s, // can be zero, to disable future timestamp check - time_t overwrite_zero_update_every_s, // can be zero, if unknown + uint32_t overwrite_zero_update_every_s, // can be zero, if unknown bool have_read_error, const char *msg, RRDENG_COLLECT_PAGE_FLAGS flags) { @@ -732,7 +732,6 @@ VALIDATED_PAGE_DESCRIPTOR validate_page( (now_s && vd.end_time_s > now_s) || vd.start_time_s <= 0 || vd.end_time_s <= 0 || - vd.update_every_s < 0 || (vd.start_time_s == vd.end_time_s && vd.entries > 1) || (vd.update_every_s == 0 && vd.entries > 1)) { @@ -797,7 +796,7 @@ VALIDATED_PAGE_DESCRIPTOR validate_page( ); } else { - const char *err_valid = (vd.is_valid) ? "" : "found invalid, "; + const char *err_valid = ""; const char *err_start = (vd.start_time_s == start_time_s) ? "" : "start time updated, "; const char *err_end = (vd.end_time_s == end_time_s) ? "" : "end time updated, "; const char *err_update = (vd.update_every_s == update_every_s) ? "" : "update every updated, "; |