14
0
Files
python-pyfuse3/0001-timestamp-rounding-tests-avoid-y2038-issue.patch

34 lines
1.1 KiB
Diff
Raw Normal View History

From fb94a809da286a950862910a9760468aee2654fd Mon Sep 17 00:00:00 2001
From: Nikolaus Rath <Nikolaus@rath.org>
Date: Sun, 31 Jan 2021 14:49:43 +0000
Subject: [PATCH] timestamp rounding tests: avoid y2038 issue
100y was beyond y2038 and could lead to issues on 32 bit
systems (cf. https://github.com/python-llfuse/python-llfuse/issues/60).
---
test/test_rounding.py | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/test/test_rounding.py b/test/test_rounding.py
index 70865ed..58817a0 100755
--- a/test/test_rounding.py
+++ b/test/test_rounding.py
@@ -22,12 +22,14 @@ def test_rounding():
# all dates.
entry = pyfuse3.EntryAttributes()
- # Approximately 100 years, ending in 999
- secs = 100 * 365 * 24 * 3600 + 999
+ # Approximately 67 years, ending in 999.
+ # Note: 67 years were chosen to avoid y2038 issues (1970 + 67 = 2037).
+ # Testing these is **not** in scope of this test.
+ secs = 67 * 365 * 24 * 3600 + 999
nanos = _NANOS_PER_SEC - 1
total = secs * _NANOS_PER_SEC + nanos
-
+
entry.st_atime_ns = total
entry.st_ctime_ns = total
entry.st_mtime_ns = total