diff options
author | Sam James <sam@gentoo.org> | 2024-02-05 23:23:20 +0000 |
---|---|---|
committer | Carlos Maiolino <cem@kernel.org> | 2024-02-16 14:47:33 +0100 |
commit | ebe85b803bc8d97cc44dcab74a23803f31e45994 (patch) | |
tree | 910c54221305afe04dff52203cdb9cced9eeac36 | |
parent | 9e726740f107e57280714bae0ddc582e9b98d580 (diff) | |
download | xfsprogs-dev-ebe85b803bc8d97cc44dcab74a23803f31e45994.tar.gz |
io: 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" <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sam James <sam@gentoo.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
-rw-r--r-- | io/stat.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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)); |