diff options
author | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2021-12-29 10:20:46 -0300 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2022-01-17 10:57:09 -0300 |
commit | 9fe6f6363886aae6b2b210cae3ed1f5921299083 (patch) | |
tree | d601541a207382c53aa7dfd6ccc256805ec34294 /elf/cache.c | |
parent | cedd498dbc090e39a9b3224f4c53ea98da049f40 (diff) | |
download | glibc-9fe6f6363886aae6b2b210cae3ed1f5921299083.tar glibc-9fe6f6363886aae6b2b210cae3ed1f5921299083.tar.gz glibc-9fe6f6363886aae6b2b210cae3ed1f5921299083.tar.bz2 glibc-9fe6f6363886aae6b2b210cae3ed1f5921299083.zip |
elf: Fix 64 time_t support for installed statically binaries
The usage of internal static symbol for statically linked binaries
does not work correctly for objects built with -D_TIME_BITS=64,
since the internal definition does not provide the expected aliases.
This patch makes it to use the default stat functions instead (which
uses the default 64 time_t alias and types).
Checked on i686-linux-gnu.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
Diffstat (limited to 'elf/cache.c')
-rw-r--r-- | elf/cache.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/elf/cache.c b/elf/cache.c index 15a5b74a5f..dbf4c83a7a 100644 --- a/elf/cache.c +++ b/elf/cache.c @@ -318,8 +318,8 @@ print_cache (const char *cache_name) if (fd < 0) error (EXIT_FAILURE, errno, _("Can't open cache file %s\n"), cache_name); - struct stat64 st; - if (__fstat64 (fd, &st) < 0 + struct stat st; + if (fstat (fd, &st) < 0 /* No need to map the file if it is empty. */ || st.st_size == 0) { @@ -932,7 +932,7 @@ init_aux_cache (void) } int -search_aux_cache (struct stat64 *stat_buf, int *flags, +search_aux_cache (struct stat *stat_buf, int *flags, unsigned int *osversion, unsigned int *isa_level, char **soname) { @@ -994,7 +994,7 @@ insert_to_aux_cache (struct aux_cache_entry_id *id, int flags, } void -add_to_aux_cache (struct stat64 *stat_buf, int flags, +add_to_aux_cache (struct stat *stat_buf, int flags, unsigned int osversion, unsigned int isa_level, const char *soname) { @@ -1017,8 +1017,8 @@ load_aux_cache (const char *aux_cache_name) return; } - struct stat64 st; - if (__fstat64 (fd, &st) < 0 || st.st_size < sizeof (struct aux_cache_file)) + struct stat st; + if (fstat (fd, &st) < 0 || st.st_size < sizeof (struct aux_cache_file)) { close (fd); init_aux_cache (); @@ -1134,8 +1134,8 @@ save_aux_cache (const char *aux_cache_name) char *dir = strdupa (aux_cache_name); dir = dirname (dir); - struct stat64 st; - if (stat64 (dir, &st) < 0) + struct stat st; + if (stat (dir, &st) < 0) { if (mkdir (dir, 0700) < 0) goto out_fail; |