summaryrefslogtreecommitdiff
path: root/lib/tempname.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2021-01-08 17:31:28 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2021-01-08 17:56:15 -0800
commit551b70f4d0a975f3fa7b91bd2a040e71797d8c9d (patch)
treeb9e591a93e34d0cea96de992974afb9173e36d6a /lib/tempname.c
parent87ed1f9c4bc4ae9e98e1293465a5b3a929b9c3f9 (diff)
downloadgnulib-551b70f4d0a975f3fa7b91bd2a040e71797d8c9d.tar.gz
tempname: sync with proposed glibc patch
This is from Adhemerval Zanella in: https://sourceware.org/pipermail/libc-alpha/2021-January/121301.html * lib/tempname.c (__lxstat64): Remove. (__lstat64, __stat64): New replacement macros. All uses changed.
Diffstat (limited to 'lib/tempname.c')
-rw-r--r--lib/tempname.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/tempname.c b/lib/tempname.c
index 9ed67fec2c..f196b98622 100644
--- a/lib/tempname.c
+++ b/lib/tempname.c
@@ -61,7 +61,8 @@
# define __gen_tempname gen_tempname
# define __mkdir mkdir
# define __open open
-# define __lxstat64(version, file, buf) lstat (file, buf)
+# define __lstat64(file, buf) lstat (file, buf)
+# define __stat64(file, buf) stat (file, buf)
# define __getrandom getrandom
# define __clock_gettime64 clock_gettime
# define __timespec64 timespec
@@ -96,7 +97,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
@@ -188,7 +189,7 @@ try_nocreate (char *tmpl, void *flags _GL_UNUSED)
{
struct_stat64 st;
- if (__lxstat64 (_STAT_VER, tmpl, &st) == 0 || errno == EOVERFLOW)
+ if (__lstat64 (tmpl, &st) == 0 || errno == EOVERFLOW)
__set_errno (EEXIST);
return errno == ENOENT ? 0 : -1;
}