[oe-commits] [openembedded-core] 08/23: systemd: Fix time_t size assumptions

git at git.openembedded.org git at git.openembedded.org
Mon Dec 30 23:40:15 UTC 2019


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master
in repository openembedded-core.

commit 7f6aa3a10a3d31ef9b02b5ca2a1d8fcffdfcd334
Author: Khem Raj <raj.khem at gmail.com>
AuthorDate: Sun Dec 29 10:43:58 2019 -0800

    systemd: Fix time_t size assumptions
    
    Signed-off-by: Khem Raj <raj.khem at gmail.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 ...-instead-of-TIME_T_MAX-for-timerfd_settim.patch | 31 ++++++++++++++++++++++
 meta/recipes-core/systemd/systemd_243.2.bb         |  1 +
 2 files changed, 32 insertions(+)

diff --git a/meta/recipes-core/systemd/systemd/0022-Use-INT_MAX-instead-of-TIME_T_MAX-for-timerfd_settim.patch b/meta/recipes-core/systemd/systemd/0022-Use-INT_MAX-instead-of-TIME_T_MAX-for-timerfd_settim.patch
new file mode 100644
index 0000000..76a1c73
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0022-Use-INT_MAX-instead-of-TIME_T_MAX-for-timerfd_settim.patch
@@ -0,0 +1,31 @@
+From 6bcf562bd1e541c7aa46923d9a14201c7f785261 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem at 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 at 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
+
diff --git a/meta/recipes-core/systemd/systemd_243.2.bb b/meta/recipes-core/systemd/systemd_243.2.bb
index ac7a5f8..3f68604 100644
--- a/meta/recipes-core/systemd/systemd_243.2.bb
+++ b/meta/recipes-core/systemd/systemd_243.2.bb
@@ -46,6 +46,7 @@ SRC_URI_MUSL = "\
                file://0019-Hide-__start_BUS_ERROR_MAP-and-__stop_BUS_ERROR_MAP.patch \
                file://0020-missing_type.h-add-__compar_d_fn_t-definition.patch \
                file://0021-avoid-redefinition-of-prctl_mm_map-structure.patch \
+               file://0022-Use-INT_MAX-instead-of-TIME_T_MAX-for-timerfd_settim.patch \
                file://0024-test-json.c-define-M_PIl.patch \
                file://0001-do-not-disable-buffer-in-writing-files.patch \
                file://0002-src-login-brightness.c-include-sys-wait.h.patch \

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list