From 52a5fe70a2c77935afe807fb6e904e512ddd894e Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Tue, 2 Mar 2021 17:06:02 -0300 Subject: Use 64 bit time_t stat internally For the legacy ABI with supports 32-bit time_t it calls the 64-bit time directly, since the LFS symbols calls the 64-bit time_t ones internally. Checked on i686-linux-gnu and x86_64-linux-gnu. Reviewed-by: Lukasz Majewski --- csu/check_fds.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'csu') diff --git a/csu/check_fds.c b/csu/check_fds.c index fbab28c..6dc6733 100644 --- a/csu/check_fds.c +++ b/csu/check_fds.c @@ -69,10 +69,10 @@ check_one_fd (int fd, int mode) Note that the following code assumes that STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO are the three lowest file decsriptor numbers, in this order. */ - struct stat64 st; - if (__builtin_expect (nullfd != fd, 0) - || __builtin_expect (__fstat64 (fd, &st), 0) != 0 - || __builtin_expect (S_ISCHR (st.st_mode), 1) == 0 + struct __stat64_t64 st; + if (__glibc_unlikely (nullfd != fd) + || __glibc_likely (__fstat64_time64 (fd, &st) != 0) + || __glibc_unlikely (S_ISCHR (st.st_mode) == 0) || st.st_rdev != dev) /* We cannot even give an error message here since it would run into the same problems. */ -- cgit v1.1