diff options
author | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2021-03-02 17:06:02 -0300 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2021-06-22 12:09:52 -0300 |
commit | 52a5fe70a2c77935afe807fb6e904e512ddd894e (patch) | |
tree | e17476a3ebc60b2e00aea93f24227199caaee8d4 /sysdeps/posix/tempname.c | |
parent | a318262bc0081ab83e3f3c90e50462f99148605e (diff) | |
download | glibc-52a5fe70a2c77935afe807fb6e904e512ddd894e.zip glibc-52a5fe70a2c77935afe807fb6e904e512ddd894e.tar.gz glibc-52a5fe70a2c77935afe807fb6e904e512ddd894e.tar.bz2 |
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 'sysdeps/posix/tempname.c')
-rw-r--r-- | sysdeps/posix/tempname.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sysdeps/posix/tempname.c b/sysdeps/posix/tempname.c index 5f804b3..ff38f1e 100644 --- a/sysdeps/posix/tempname.c +++ b/sysdeps/posix/tempname.c @@ -55,14 +55,14 @@ #include <time.h> #if _LIBC -# define struct_stat64 struct stat64 +# define struct_stat64 struct __stat64_t64 # define __secure_getenv __libc_secure_getenv #else # define struct_stat64 struct stat # define __gen_tempname gen_tempname # define __mkdir mkdir # define __open open -# define __lstat64(file, buf) lstat (file, buf) +# define __lstat64_time64(file, buf) lstat (file, buf) # define __stat64(file, buf) stat (file, buf) # define __getrandom getrandom # define __clock_gettime64 clock_gettime @@ -99,7 +99,7 @@ static int direxists (const char *dir) { struct_stat64 buf; - return __stat64 (dir, &buf) == 0 && S_ISDIR (buf.st_mode); + return __stat64_time64 (dir, &buf) == 0 && S_ISDIR (buf.st_mode); } /* Path search algorithm, for tmpnam, tmpfile, etc. If DIR is @@ -191,7 +191,7 @@ try_nocreate (char *tmpl, void *flags _GL_UNUSED) { struct_stat64 st; - if (__lstat64 (tmpl, &st) == 0 || errno == EOVERFLOW) + if (__lstat64_time64 (tmpl, &st) == 0 || errno == EOVERFLOW) __set_errno (EEXIST); return errno == ENOENT ? 0 : -1; } |