about summary refs log tree commit diff
path: root/csu
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2021-03-02 17:06:02 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2021-06-22 12:09:52 -0300
commit52a5fe70a2c77935afe807fb6e904e512ddd894e (patch)
treee17476a3ebc60b2e00aea93f24227199caaee8d4 /csu
parenta318262bc0081ab83e3f3c90e50462f99148605e (diff)
downloadglibc-52a5fe70a2c77935afe807fb6e904e512ddd894e.tar.gz
glibc-52a5fe70a2c77935afe807fb6e904e512ddd894e.tar.xz
glibc-52a5fe70a2c77935afe807fb6e904e512ddd894e.zip
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 <lukma@denx.de>
Diffstat (limited to 'csu')
-rw-r--r--csu/check_fds.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/csu/check_fds.c b/csu/check_fds.c
index fbab28c284..6dc67334af 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.  */