]> git.pld-linux.org Git - packages/file.git/commitdiff
upstream fix for platforms with 32-bit time_t; rel 2 auto/th/file-5.45-2
authorJan Palus <atler@pld-linux.org>
Tue, 1 Aug 2023 18:50:45 +0000 (20:50 +0200)
committerJan Palus <atler@pld-linux.org>
Tue, 1 Aug 2023 18:50:45 +0000 (20:50 +0200)
file.spec
time_t-32bit.patch [new file with mode: 0644]

index 978c639eb8c7fc8b15fd36428586bca3550aeb96..edcba4ab1a95eebe8bf717fad32d46ab1ba253bd 100644 (file)
--- a/file.spec
+++ b/file.spec
@@ -35,7 +35,7 @@ Summary(zh_CN.UTF-8): 判定文件类型的工具。
 Summary(zh_TW.UTF-8):  用於決定檔案類型的一個工具程式。
 Name:          file
 Version:       5.45
-Release:       1
+Release:       2
 License:       distributable
 Group:         Applications/File
 Source0:       ftp://ftp.astron.com/pub/file/%{name}-%{version}.tar.gz
@@ -49,6 +49,7 @@ Patch0:               searchpath.patch
 Patch1:                automake.patch
 Patch2:                %{name}-gettext-no-random-translations.patch
 Patch3:                name-use-count.patch
+Patch4:                time_t-32bit.patch
 URL:           http://www.darwinsys.com/file/
 BuildRequires: autoconf >= 2.50
 BuildRequires: automake
@@ -290,6 +291,7 @@ Wiązania Pythona 3 do biblioteki libmagic.
 %patch1 -p1
 %patch2 -p1
 %patch3 -p1
+%patch4 -p1
 
 %if "%{_ver_lt '%{cc_version}' '3.4'}" == "1"
 %{__sed} -i -e 's,-Wextra,,' configure.ac
diff --git a/time_t-32bit.patch b/time_t-32bit.patch
new file mode 100644 (file)
index 0000000..bb5ebc0
--- /dev/null
@@ -0,0 +1,36 @@
+From 218fdf813fd5ccecbb8887a1b62509cd1c6dd3a1 Mon Sep 17 00:00:00 2001
+From: Christos Zoulas <christos@zoulas.com>
+Date: Fri, 28 Jul 2023 14:38:25 +0000
+Subject: [PATCH] deal with 32 bit time_t
+
+---
+ src/file.h | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/src/file.h b/src/file.h
+index 2e0494d2f..78f574ea1 100644
+--- a/src/file.h
++++ b/src/file.h
+@@ -27,7 +27,7 @@
+  */
+ /*
+  * file.h - definitions for file(1) program
+- * @(#)$File: file.h,v 1.247 2023/07/27 19:40:22 christos Exp $
++ * @(#)$File: file.h,v 1.248 2023/07/28 14:38:25 christos Exp $
+  */
+ #ifndef __file_h__
+@@ -159,9 +159,11 @@
+ /*
+  * Dec 31, 23:59:59 9999
+  * we need to make sure that we don't exceed 9999 because some libc
+- * implementations like muslc crash otherwise
++ * implementations like muslc crash otherwise. If you are unlucky
++ * to be running on a system with a 32 bit time_t, then it is even less.
+  */
+-#define       MAX_CTIME       CAST(time_t, 0x3afff487cfULL)
++#define       MAX_CTIME \
++    CAST(time_t, sizeof(time_t) > 4 ? 0x3afff487cfULL : 0x7fffffffULL)
+ #define FILE_BADSIZE CAST(size_t, ~0ul)
+ #define MAXDESC       64              /* max len of text description/MIME type */
This page took 0.174689 seconds and 4 git commands to generate.