pytrainer: unpin python 3.10
[NixPkgs.git] / pkgs / tools / misc / file / 32-bit-time_t.patch
blob19c595215d65b0db8285921a4922bdd1d61c6bda
1 https://github.com/file/file/commit/218fdf813fd5ccecbb8887a1b62509cd1c6dd3a1.patch
3 From 218fdf813fd5ccecbb8887a1b62509cd1c6dd3a1 Mon Sep 17 00:00:00 2001
4 From: Christos Zoulas <christos@zoulas.com>
5 Date: Fri, 28 Jul 2023 14:38:25 +0000
6 Subject: [PATCH] deal with 32 bit time_t
8 ---
9 src/file.h | 8 +++++---
10 1 file changed, 5 insertions(+), 3 deletions(-)
12 diff --git a/src/file.h b/src/file.h
13 index 2e0494d2f..78f574ea1 100644
14 --- a/src/file.h
15 +++ b/src/file.h
16 @@ -27,7 +27,7 @@
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 $
24 #ifndef __file_h__
25 @@ -159,9 +159,11 @@
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.
33 -#define MAX_CTIME CAST(time_t, 0x3afff487cfULL)
34 +#define MAX_CTIME \
35 + CAST(time_t, sizeof(time_t) > 4 ? 0x3afff487cfULL : 0x7fffffffULL)
37 #define FILE_BADSIZE CAST(size_t, ~0ul)
38 #define MAXDESC 64 /* max len of text description/MIME type */