commit 6065c117b6569951cbdb32122977d8e13f89c8a0
parent ed02da661939189dff6c4b2a56f2c72cba98e7c5
Author: Christian Grothoff <christian@grothoff.org>
Date: Tue, 28 Oct 2025 19:56:43 +0100
use localtime, makes more sense for rounding
Diffstat:
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/lib/util/time.c b/src/lib/util/time.c
@@ -992,8 +992,8 @@ GNUNET_TIME_round_up (struct GNUNET_TIME_Absolute at,
if (GNUNET_TIME_RI_NONE == ri)
return at;
seconds = at.abs_value_us / 1000000;
- if (NULL == gmtime_r (&seconds,
- &timeinfo))
+ if (NULL == localtime_r (&seconds,
+ &timeinfo))
{
GNUNET_break (0);
return at;
@@ -1112,7 +1112,7 @@ GNUNET_TIME_round_up (struct GNUNET_TIME_Absolute at,
}
break;
}
- result.abs_value_us = ((uint64_t) timegm (&timeinfo)) * 1000000ULL;
+ result.abs_value_us = ((uint64_t) mktime (&timeinfo)) * 1000000ULL;
return result;
}
@@ -1130,8 +1130,8 @@ GNUNET_TIME_round_down (struct GNUNET_TIME_Absolute at,
if (GNUNET_TIME_RI_NONE == ri)
return at;
seconds = at.abs_value_us / 1000000;
- if (NULL == gmtime_r (&seconds,
- &timeinfo))
+ if (NULL == localtime_r (&seconds,
+ &timeinfo))
{
GNUNET_break (0);
return at;
@@ -1196,7 +1196,7 @@ GNUNET_TIME_round_down (struct GNUNET_TIME_Absolute at,
timeinfo.tm_mon = 0;
break;
}
- result.abs_value_us = (uint64_t) timegm (&timeinfo) * 1000000ULL;
+ result.abs_value_us = (uint64_t) mktime (&timeinfo) * 1000000ULL;
return result;
}