From a9acb7b39ed21386142b963aeecc35e0b468c0de Mon Sep 17 00:00:00 2001 From: YunQiang Su Date: Tue, 8 Nov 2022 12:49:46 +0800 Subject: Define in_int32_t_range to check if the 64 bit time_t syscall should be used Currently glibc uses in_time_t_range to detects time_t overflow, and if it occurs fallbacks to 64 bit syscall version. The function name is confusing because internally time_t might be either 32 bits or 64 bits (depending on __TIMESIZE). This patch refactors the in_time_t_range by replacing it with in_int32_t_range for the case to check if the 64 bit time_t syscall should be used. The in_time_t range is used to detect overflow of the syscall return value. Reviewed-by: Adhemerval Zanella --- sysdeps/unix/sysv/linux/utimensat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sysdeps/unix/sysv/linux/utimensat.c') diff --git a/sysdeps/unix/sysv/linux/utimensat.c b/sysdeps/unix/sysv/linux/utimensat.c index 5662ecc..54a5e47 100644 --- a/sysdeps/unix/sysv/linux/utimensat.c +++ b/sysdeps/unix/sysv/linux/utimensat.c @@ -41,9 +41,9 @@ __utimensat64_helper (int fd, const char *file, bool need_time64 = tsp64 != NULL && ((!TS_SPECIAL (tsp64[0]) - && !in_time_t_range (tsp64[0].tv_sec)) + && !in_int32_t_range (tsp64[0].tv_sec)) || (!TS_SPECIAL (tsp64[1]) - && !in_time_t_range (tsp64[1].tv_sec))); + && !in_int32_t_range (tsp64[1].tv_sec))); if (need_time64) { int r = INLINE_SYSCALL_CALL (utimensat_time64, fd, file, &tsp64[0], -- cgit v1.1