aboutsummaryrefslogtreecommitdiff
path: root/locale
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 /locale
parenta318262bc0081ab83e3f3c90e50462f99148605e (diff)
downloadglibc-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 'locale')
-rw-r--r--locale/loadarchive.c8
-rw-r--r--locale/loadlocale.c6
2 files changed, 7 insertions, 7 deletions
diff --git a/locale/loadarchive.c b/locale/loadarchive.c
index 4177fc8..512769e 100644
--- a/locale/loadarchive.c
+++ b/locale/loadarchive.c
@@ -78,7 +78,7 @@ static struct archmapped *archmapped;
ARCHMAPPED points to this; if mapping the archive header failed,
then headmap.ptr is null. */
static struct archmapped headmap;
-static struct stat64 archive_stat; /* stat of archive when header mapped. */
+static struct __stat64_t64 archive_stat; /* stat of archive when header mapped. */
/* Record of locales that we have already loaded from the archive. */
struct locale_in_archive
@@ -207,7 +207,7 @@ _nl_load_locale_from_archive (int category, const char **namep)
/* Cannot open the archive, for whatever reason. */
return NULL;
- if (__fstat64 (fd, &archive_stat) == -1)
+ if (__fstat64_time64 (fd, &archive_stat) == -1)
{
/* stat failed, very strange. */
close_and_out:
@@ -396,7 +396,7 @@ _nl_load_locale_from_archive (int category, const char **namep)
/* Open the file if it hasn't happened yet. */
if (fd == -1)
{
- struct stat64 st;
+ struct __stat64_t64 st;
fd = __open_nocancel (archfname,
O_RDONLY|O_LARGEFILE|O_CLOEXEC);
if (fd == -1)
@@ -405,7 +405,7 @@ _nl_load_locale_from_archive (int category, const char **namep)
/* Now verify we think this is really the same archive file
we opened before. If it has been changed we cannot trust
the header we read previously. */
- if (__fstat64 (fd, &st) < 0
+ if (__fstat64_time64 (fd, &st) < 0
|| st.st_size != archive_stat.st_size
|| st.st_mtime != archive_stat.st_mtime
|| st.st_dev != archive_stat.st_dev
diff --git a/locale/loadlocale.c b/locale/loadlocale.c
index 9c03490..f4e6cc9 100644
--- a/locale/loadlocale.c
+++ b/locale/loadlocale.c
@@ -167,7 +167,7 @@ _nl_load_locale (struct loaded_l10nfile *file, int category)
{
int fd;
void *filedata;
- struct stat64 st;
+ struct __stat64_t64 st;
struct __locale_data *newdata;
int save_err;
int alloc = ld_mapped;
@@ -180,7 +180,7 @@ _nl_load_locale (struct loaded_l10nfile *file, int category)
/* Cannot open the file. */
return;
- if (__builtin_expect (__fstat64 (fd, &st), 0) < 0)
+ if (__glibc_unlikely (__fstat64_time64 (fd, &st) < 0))
{
puntfd:
__close_nocancel_nostatus (fd);
@@ -206,7 +206,7 @@ _nl_load_locale (struct loaded_l10nfile *file, int category)
if (__builtin_expect (fd, 0) < 0)
return;
- if (__builtin_expect (__fstat64 (fd, &st), 0) < 0)
+ if (__glibc_unlikely (__fstat64_time64 (fd, &st) < 0))
goto puntfd;
}