1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-06-08 23:37:47 +02:00

agent: Fix timer list management.

* agent/cache.c (insert_to_timer_list): Update TV_SEC of the top entry
when inserted.

--

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2023-09-01 11:28:44 +09:00
parent 57125d3f5a
commit 5e47d5edd8
No known key found for this signature in database
GPG Key ID: 640114AF89DE6054

View File

@ -226,8 +226,12 @@ insert_to_timer_list (struct timespec *ts, ITEM entry)
if (!the_timer_list || ts->tv_sec >= entry->t.tv_sec) if (!the_timer_list || ts->tv_sec >= entry->t.tv_sec)
{ {
if (the_timer_list && ts->tv_nsec) if (the_timer_list)
{
the_timer_list->t.tv_sec += ts->tv_sec - entry->t.tv_sec;
if (ts->tv_nsec)
the_timer_list->t.tv_sec++; the_timer_list->t.tv_sec++;
}
ts->tv_sec = entry->t.tv_sec; ts->tv_sec = entry->t.tv_sec;
ts->tv_nsec = 0; ts->tv_nsec = 0;