From 6ab5a1f1711d82eba522652fecdd5e72ee10b48b Mon Sep 17 00:00:00 2001 From: xuchenchen Date: Fri, 19 Apr 2024 11:36:25 +0800 Subject: [PATCH] io: Adapt to >= 64-bit time_t --- 0002-Adapt-to-64-bit-time_t.patch | 42 +++++++++++++++++++++++++++++++ xfsprogs.spec | 6 ++++- 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 0002-Adapt-to-64-bit-time_t.patch diff --git a/0002-Adapt-to-64-bit-time_t.patch b/0002-Adapt-to-64-bit-time_t.patch new file mode 100644 index 0000000..81c7fe2 --- /dev/null +++ b/0002-Adapt-to-64-bit-time_t.patch @@ -0,0 +1,42 @@ +From ebe85b803bc8d97cc44dcab74a23803f31e45994 Mon Sep 17 00:00:00 2001 +From: Sam James +Date: 2024-02-05 23:23:20 +0000 +Subject: [PATCH] Adapt to >= 64-bit time_t + +We now require (at least) 64-bit time_t, so we need to adjust some printf +specifiers accordingly. + +Unfortunately, we've stumbled upon a ridiculous C mmoment whereby there's +no neat format specifier (not even one of the inttypes ones) for time_t, so +we cast to intmax_t and use %jd. + +Reviewed-by: "Darrick J. Wong" +Reviewed-by: Christoph Hellwig +Signed-off-by: Sam James +Signed-off-by: Carlos Maiolino +--- + io/stat.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/io/stat.c b/io/stat.c +index b57f9ee..26859af 100644 +--- a/io/stat.c ++++ b/io/stat.c +@@ -66,11 +66,11 @@ dump_raw_stat(struct stat *st) + printf("stat.ino = %llu\n", (unsigned long long)st->st_ino); + printf("stat.size = %lld\n", (long long)st->st_size); + printf("stat.blocks = %lld\n", (long long)st->st_blocks); +- printf("stat.atime.tv_sec = %ld\n", st->st_atim.tv_sec); ++ printf("stat.atime.tv_sec = %jd\n", (intmax_t)st->st_atim.tv_sec); + printf("stat.atime.tv_nsec = %ld\n", st->st_atim.tv_nsec); +- printf("stat.ctime.tv_sec = %ld\n", st->st_ctim.tv_sec); ++ printf("stat.ctime.tv_sec = %jd\n", (intmax_t)st->st_ctim.tv_sec); + printf("stat.ctime.tv_nsec = %ld\n", st->st_ctim.tv_nsec); +- printf("stat.mtime.tv_sec = %ld\n", st->st_mtim.tv_sec); ++ printf("stat.mtime.tv_sec = %jd\n", (intmax_t)st->st_mtim.tv_sec); + printf("stat.mtime.tv_nsec = %ld\n", st->st_mtim.tv_nsec); + printf("stat.rdev_major = %u\n", major(st->st_rdev)); + printf("stat.rdev_minor = %u\n", minor(st->st_rdev)); +-- +2.33.0 + diff --git a/xfsprogs.spec b/xfsprogs.spec index 2dcc586..6c93d18 100644 --- a/xfsprogs.spec +++ b/xfsprogs.spec @@ -1,6 +1,6 @@ Name: xfsprogs Version: 6.6.0 -Release: 1 +Release: 2 Summary: Administration and debugging tools for the XFS file system License: GPL+ and LGPLv2+ URL: https://xfs.wiki.kernel.org @@ -20,6 +20,7 @@ Conflicts: xfsdump < 3.0.1 Patch0: xfsprogs-5.12.0-default-bigtime-inobtcnt-on.patch Patch1: 0001-xfsprogs-Add-sw64-architecture.patch +Patch2: 0002-Adapt-to-64-bit-time_t.patch %description xfsprogs are the userspace utilities that manage XFS filesystems. @@ -101,6 +102,9 @@ rm -rf %{buildroot}%{_datadir}/doc/xfsprogs/ %changelog +* Fri Apr 19 2024 xuchenchen - 6.6.0-2 +- io: Adapt to >= 64-bit time_t + * Tue Feb 27 2024 wuguanghao - 6.6.0-1 - upgrade version to 6.6.0 -- Gitee