teknoraver / rpms / rpm

Forked from rpms/rpm 2 months ago
Clone

Blame 0001-Use-unsigned-integers-for-buildtime-too-for-Y2K38-sa.patch

Michal Domonkos 590afc
From 97aa64d8281974fb369c66d5aef8650515b89c52 Mon Sep 17 00:00:00 2001
Michal Domonkos 590afc
From: Panu Matilainen <pmatilai@redhat.com>
Michal Domonkos 590afc
Date: Wed, 24 Jan 2024 12:03:39 +0200
Michal Domonkos 590afc
Subject: [PATCH] Use unsigned integers for buildtime too for Y2K38 safety
Michal Domonkos 590afc
Michal Domonkos 590afc
This little patch buys us 68 extra years to move to 64bit time tags
Michal Domonkos 590afc
in rpm. That seems achievable.
Michal Domonkos 590afc
Michal Domonkos 590afc
Fixes: #1228
Michal Domonkos 590afc
---
Michal Domonkos 590afc
 build/build.c | 4 ++--
Michal Domonkos 590afc
 1 file changed, 2 insertions(+), 2 deletions(-)
Michal Domonkos 590afc
Michal Domonkos 590afc
diff --git a/build/build.c b/build/build.c
Michal Domonkos 590afc
index e4081c673..0ac8bf6c9 100644
Michal Domonkos 590afc
--- a/build/build.c
Michal Domonkos 590afc
+++ b/build/build.c
Michal Domonkos 590afc
@@ -36,9 +36,9 @@ static rpm_time_t getBuildTime(void)
Michal Domonkos 590afc
         if (srcdate == endptr || *endptr || errno != 0)
Michal Domonkos 590afc
             rpmlog(RPMLOG_ERR, _("unable to parse SOURCE_DATE_EPOCH\n"));
Michal Domonkos 590afc
         else
Michal Domonkos 590afc
-            buildTime = (int32_t) epoch;
Michal Domonkos 590afc
+            buildTime = (uint32_t) epoch;
Michal Domonkos 590afc
     } else
Michal Domonkos 590afc
-        buildTime = (int32_t) time(NULL);
Michal Domonkos 590afc
+        buildTime = (uint32_t) time(NULL);
Michal Domonkos 590afc
 
Michal Domonkos 590afc
     return buildTime;
Michal Domonkos 590afc
 }
Michal Domonkos 590afc
-- 
Michal Domonkos 590afc
2.45.1
Michal Domonkos 590afc