1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

agent: Fix timer round-up check when inserting an entry into cache.

* agent/cache.c (insert_to_timer_list): Round up when >= a half second.

--

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2023-09-04 12:00:29 +09:00
parent 28364affa6
commit d90f1e5fa4
No known key found for this signature in database
GPG Key ID: 640114AF89DE6054

View File

@ -229,7 +229,7 @@ insert_to_timer_list (struct timespec *ts, ITEM entry)
if (the_timer_list) if (the_timer_list)
{ {
the_timer_list->t.tv_sec += ts->tv_sec - entry->t.tv_sec; the_timer_list->t.tv_sec += ts->tv_sec - entry->t.tv_sec;
if (ts->tv_nsec) if (ts->tv_nsec >= 500000000)
the_timer_list->t.tv_sec++; the_timer_list->t.tv_sec++;
} }