1https://github.com/file/file/commit/218fdf813fd5ccecbb8887a1b62509cd1c6dd3a1.patch
2
3From 218fdf813fd5ccecbb8887a1b62509cd1c6dd3a1 Mon Sep 17 00:00:00 2001
4From: Christos Zoulas <christos@zoulas.com>
5Date: Fri, 28 Jul 2023 14:38:25 +0000
6Subject: [PATCH] deal with 32 bit time_t
7
8---
9 src/file.h | 8 +++++---
10 1 file changed, 5 insertions(+), 3 deletions(-)
11
12diff --git a/src/file.h b/src/file.h
13index 2e0494d2f..78f574ea1 100644
14--- a/src/file.h
15+++ b/src/file.h
16@@ -27,7 +27,7 @@
17 */
18 /*
19 * file.h - definitions for file(1) program
20- * @(#)$File: file.h,v 1.247 2023/07/27 19:40:22 christos Exp $
21+ * @(#)$File: file.h,v 1.248 2023/07/28 14:38:25 christos Exp $
22 */
23
24 #ifndef __file_h__
25@@ -159,9 +159,11 @@
26 /*
27 * Dec 31, 23:59:59 9999
28 * we need to make sure that we don't exceed 9999 because some libc
29- * implementations like muslc crash otherwise
30+ * implementations like muslc crash otherwise. If you are unlucky
31+ * to be running on a system with a 32 bit time_t, then it is even less.
32 */
33-#define MAX_CTIME CAST(time_t, 0x3afff487cfULL)
34+#define MAX_CTIME \
35+ CAST(time_t, sizeof(time_t) > 4 ? 0x3afff487cfULL : 0x7fffffffULL)
36
37 #define FILE_BADSIZE CAST(size_t, ~0ul)
38 #define MAXDESC 64 /* max len of text description/MIME type */