Fix type in dbrrd_closest()

For ABS() to work, the argument must be signed, but rrdd_time is
uint64_t.  Clang noticed it.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Mariusz Zaborski <mariusz.zaborski@klarasystems.com>
Signed-off-by: Alexander Motin <alexander.motin@TrueNAS.com>
Fixes #16853
Closes #17733
This commit is contained in:
Alexander Motin 2025-09-12 14:05:38 -04:00 committed by Brian Behlendorf
parent b5d41deca9
commit 41c6eaac8b

View File

@ -208,7 +208,8 @@ dbrrd_closest(hrtime_t tv, const rrd_data_t *r1, const rrd_data_t *r2)
if (r2 == NULL)
return (r1);
return (ABS(tv - r1->rrdd_time) < ABS(tv - r2->rrdd_time) ? r1 : r2);
return (ABS(tv - (hrtime_t)r1->rrdd_time) <
ABS(tv - (hrtime_t)r2->rrdd_time) ? r1 : r2);
}
uint64_t