about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/ttyname.c
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2020-07-15 19:35:58 +0000
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2020-09-11 14:35:32 -0300
commit04986243d1af37ac0177ed2f9db0a066ebd2b212 (patch)
tree87b9cebcc14f51dd0cf4103be16fc26542b65c69 /sysdeps/unix/sysv/linux/ttyname.c
parent23159962159038891d3211c5632c3900d465f0c7 (diff)
downloadglibc-04986243d1af37ac0177ed2f9db0a066ebd2b212.tar.gz
glibc-04986243d1af37ac0177ed2f9db0a066ebd2b212.tar.xz
glibc-04986243d1af37ac0177ed2f9db0a066ebd2b212.zip
Remove internal usage of extensible stat functions
It replaces the internal usage of __{f,l}xstat{at}{64} with the
__{f,l}stat{at}{64}.  It should not change the generate code since
sys/stat.h explicit defines redirections to internal calls back to
xstat* symbols.

Checked with a build for all affected ABIs.  I also check on
x86_64-linux-gnu and i686-linux-gnu.

Reviewed-by: Lukasz Majewski <lukma@denx.de>
Diffstat (limited to 'sysdeps/unix/sysv/linux/ttyname.c')
-rw-r--r--sysdeps/unix/sysv/linux/ttyname.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sysdeps/unix/sysv/linux/ttyname.c b/sysdeps/unix/sysv/linux/ttyname.c
index c05ca687f5..5fa6645353 100644
--- a/sysdeps/unix/sysv/linux/ttyname.c
+++ b/sysdeps/unix/sysv/linux/ttyname.c
@@ -84,7 +84,7 @@ getttyname (const char *dev, const struct stat64 *mytty, int save, int *dostat)
 	    *((char *) __mempcpy (getttyname_name, dev, devlen - 1)) = '/';
 	  }
 	memcpy (&getttyname_name[devlen], d->d_name, dlen);
-	if (__xstat64 (_STAT_VER, getttyname_name, &st) == 0
+	if (__stat64 (getttyname_name, &st) == 0
 	    && is_mytty (mytty, &st))
 	  {
 	    (void) __closedir (dirstream);
@@ -125,7 +125,7 @@ ttyname (int fd)
   if (__glibc_unlikely (__tcgetattr (fd, &term) < 0))
     return NULL;
 
-  if (__fxstat64 (_STAT_VER, fd, &st) < 0)
+  if (__fstat64 (fd, &st) < 0)
     return NULL;
 
   /* We try using the /proc filesystem.  */
@@ -162,14 +162,14 @@ ttyname (int fd)
 
       /* Verify readlink result, fall back on iterating through devices.  */
       if (ttyname_buf[0] == '/'
-	  && __xstat64 (_STAT_VER, ttyname_buf, &st1) == 0
+	  && __stat64 (ttyname_buf, &st1) == 0
 	  && is_mytty (&st, &st1))
 	return ttyname_buf;
 
       doispty = 1;
     }
 
-  if (__xstat64 (_STAT_VER, "/dev/pts", &st1) == 0 && S_ISDIR (st1.st_mode))
+  if (__stat64 ("/dev/pts", &st1) == 0 && S_ISDIR (st1.st_mode))
     {
       name = getttyname ("/dev/pts", &st, save, &dostat);
     }