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/unix/sysv/linux/ttyname_r.c | |
parent | a318262bc0081ab83e3f3c90e50462f99148605e (diff) | |
download | glibc-52a5fe70a2c77935afe807fb6e904e512ddd894e.tar glibc-52a5fe70a2c77935afe807fb6e904e512ddd894e.tar.gz glibc-52a5fe70a2c77935afe807fb6e904e512ddd894e.tar.bz2 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 'sysdeps/unix/sysv/linux/ttyname_r.c')
-rw-r--r-- | sysdeps/unix/sysv/linux/ttyname_r.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sysdeps/unix/sysv/linux/ttyname_r.c b/sysdeps/unix/sysv/linux/ttyname_r.c index 899a851a83..9ef9f42883 100644 --- a/sysdeps/unix/sysv/linux/ttyname_r.c +++ b/sysdeps/unix/sysv/linux/ttyname_r.c @@ -31,15 +31,15 @@ #include "ttyname.h" static int getttyname_r (char *buf, size_t buflen, - const struct stat64 *mytty, int save, + const struct __stat64_t64 *mytty, int save, int *dostat); static int attribute_compat_text_section -getttyname_r (char *buf, size_t buflen, const struct stat64 *mytty, +getttyname_r (char *buf, size_t buflen, const struct __stat64_t64 *mytty, int save, int *dostat) { - struct stat64 st; + struct __stat64_t64 st; DIR *dirstream; struct dirent64 *d; size_t devlen = strlen (buf); @@ -71,7 +71,7 @@ getttyname_r (char *buf, size_t buflen, const struct stat64 *mytty, cp = __stpncpy (buf + devlen, d->d_name, needed); cp[0] = '\0'; - if (__stat64 (buf, &st) == 0 + if (__stat64_time64 (buf, &st) == 0 && is_mytty (mytty, &st)) { (void) __closedir (dirstream); @@ -93,7 +93,7 @@ int __ttyname_r (int fd, char *buf, size_t buflen) { struct fd_to_filename filename; - struct stat64 st, st1; + struct __stat64_t64 st, st1; int dostat = 0; int doispty = 0; int save = errno; @@ -118,7 +118,7 @@ __ttyname_r (int fd, char *buf, size_t buflen) if (__glibc_unlikely (__tcgetattr (fd, &term) < 0)) return errno; - if (__fstat64 (fd, &st) < 0) + if (__fstat64_time64 (fd, &st) < 0) return errno; /* We try using the /proc filesystem. */ @@ -144,7 +144,7 @@ __ttyname_r (int fd, char *buf, size_t buflen) /* Verify readlink result, fall back on iterating through devices. */ if (buf[0] == '/' - && __stat64 (buf, &st1) == 0 + && __stat64_time64 (buf, &st1) == 0 && is_mytty (&st, &st1)) return 0; @@ -155,7 +155,7 @@ __ttyname_r (int fd, char *buf, size_t buflen) memcpy (buf, "/dev/pts/", sizeof ("/dev/pts/")); buflen -= sizeof ("/dev/pts/") - 1; - if (__stat64 (buf, &st1) == 0 && S_ISDIR (st1.st_mode)) + if (__stat64_time64 (buf, &st1) == 0 && S_ISDIR (st1.st_mode)) { ret = getttyname_r (buf, buflen, &st, save, &dostat); |