summary refs log tree commit diff
path: root/sysdeps/posix/tempname.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/posix/tempname.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/posix/tempname.c')
-rw-r--r--sysdeps/posix/tempname.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sysdeps/posix/tempname.c b/sysdeps/posix/tempname.c
index cd48385a40..1864c860ad 100644
--- a/sysdeps/posix/tempname.c
+++ b/sysdeps/posix/tempname.c
@@ -65,7 +65,6 @@
 # define __getpid getpid
 # define __mkdir mkdir
 # define __open open
-# define __lxstat64(version, file, buf) lstat (file, buf)
 # define __secure_getenv secure_getenv
 #endif
 
@@ -96,7 +95,7 @@ static int
 direxists (const char *dir)
 {
   struct_stat64 buf;
-  return __xstat64 (_STAT_VER, dir, &buf) == 0 && S_ISDIR (buf.st_mode);
+  return __stat64 (dir, &buf) == 0 && S_ISDIR (buf.st_mode);
 }
 
 /* Path search algorithm, for tmpnam, tmpfile, etc.  If DIR is
@@ -251,10 +250,10 @@ __gen_tempname (char *tmpl, int suffixlen, int flags, int kind)
 
 	case __GT_NOCREATE:
 	  /* This case is backward from the other three.  __gen_tempname
-	     succeeds if __xstat fails because the name does not exist.
+	     succeeds if lstat fails because the name does not exist.
 	     Note the continue to bypass the common logic at the bottom
 	     of the loop.  */
-	  if (__lxstat64 (_STAT_VER, tmpl, &st) < 0)
+	  if (__lstat64 (tmpl, &st) < 0)
 	    {
 	      if (errno == ENOENT)
 		{