File: 0010-agent-Fix-timer-round-up-check-when-inserting-an-ent.patch

package info (click to toggle)
gnupg2 2.4.8-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 49,012 kB
  • sloc: ansic: 287,593; sh: 7,938; lisp: 6,735; makefile: 1,982; awk: 160; xml: 53; python: 16; sed: 16; php: 14; perl: 13
file content (27 lines) | stat: -rw-r--r-- 782 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
From: NIIBE Yutaka <gniibe@fsij.org>
Date: Mon, 4 Sep 2023 12:00:29 +0900
Subject: [PATCH 10/10] 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>
---
 agent/cache.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/agent/cache.c b/agent/cache.c
index 0525e3b..e854420 100644
--- a/agent/cache.c
+++ b/agent/cache.c
@@ -229,7 +229,7 @@ insert_to_timer_list (struct timespec *ts, ITEM entry)
       if (the_timer_list)
         {
           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++;
         }