summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/elfutils/files/0001-debuginfod-debuginfod-client.c-use-long-for-cache-ti.patch
blob: 089f1a2210e4c625c4397e0e1b4330007fbee049 (plain)
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
From a0852044907110479d0fb212dda2c5e45af2d3aa Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <alex@linutronix.de>
Date: Thu, 9 Dec 2021 10:43:06 +0100
Subject: [PATCH] debuginfod/debuginfod-client.c: use long for cache time
 configurations

time_t is platform dependent and some of architectures e.g.
x32, riscv32, arc use 64bit time_t even while they are 32bit
architectures, therefore directly using integer printf formats will not
work portably.

Use a plain long everywhere as the intervals are small enough
that it will not be problematic.

Upstream-Status: Submitted [via email to mark@klomp.org,elfutils-devel@sourceware.org]
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
 debuginfod/debuginfod-client.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/debuginfod/debuginfod-client.c b/debuginfod/debuginfod-client.c
index c875ee6..11e0fd5 100644
--- a/debuginfod/debuginfod-client.c
+++ b/debuginfod/debuginfod-client.c
@@ -134,17 +134,17 @@ struct debuginfod_client
    how frequently the cache should be cleaned. The file's st_mtime represents
    the time of last cleaning.  */
 static const char *cache_clean_interval_filename = "cache_clean_interval_s";
-static const time_t cache_clean_default_interval_s = 86400; /* 1 day */
+static const long cache_clean_default_interval_s = 86400; /* 1 day */
 
 /* The cache_miss_default_s within the debuginfod cache specifies how
    frequently the 000-permision file should be released.*/
-static const time_t cache_miss_default_s = 600; /* 10 min */
+static const long cache_miss_default_s = 600; /* 10 min */
 static const char *cache_miss_filename = "cache_miss_s";
 
 /* The cache_max_unused_age_s file within the debuginfod cache specifies the
    the maximum time since last access that a file will remain in the cache.  */
 static const char *cache_max_unused_age_filename = "max_unused_age_s";
-static const time_t cache_default_max_unused_age_s = 604800; /* 1 week */
+static const long cache_default_max_unused_age_s = 604800; /* 1 week */
 
 /* Location of the cache of files downloaded from debuginfods.
    The default parent directory is $HOME, or '/' if $HOME doesn't exist.  */