summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/systemd/systemd/0022-Use-INT_MAX-instead-of-TIME_T_MAX-for-timerfd_settim.patch
blob: 76a1c7364d43cabf86cf2061c062afc00f749cf9 (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
From 6bcf562bd1e541c7aa46923d9a14201c7f785261 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 16 Dec 2019 12:49:07 -0800
Subject: [PATCH] Use INT_MAX instead of TIME_T_MAX for timerfd_settime timeout

kernel prior to 64bit time_t support might not entertain such large
timeout therefore reduce it to INT_MAX which would set timer expiration
event after 68 years of uptime, should be good for all practical
purposes

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 src/basic/time-util.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/basic/time-util.c b/src/basic/time-util.c
index bfe2c60da1..8cf682b36a 100644
--- a/src/basic/time-util.c
+++ b/src/basic/time-util.c
@@ -1486,7 +1486,7 @@ int time_change_fd(void) {
 
         /* We only care for the cancellation event, hence we set the timeout to the latest possible value. */
         static const struct itimerspec its = {
-                .it_value.tv_sec = TIME_T_MAX,
+                .it_value.tv_sec = INT_MAX,
         };
 
         _cleanup_close_ int fd;
-- 
2.24.1