2
disable usage of unimplemented *at functions
3
revert to previous behaviour, inspired by
4
http://sourceware.org/ml/glibc-cvs/2006-q1/msg00636.html
5
http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/io/ftw.c.diff?cvsroot=glibc&r1=1.50&r2=1.51
7
http://sourceware.org/cgi-bin/cvsweb.cgi/libc/posix/glob.c.diff?cvsroot=glibc&r1=1.77&r2=1.78
11
posix/glob.c | 31 +++----------------------------
12
2 files changed, 9 insertions(+), 28 deletions(-)
18
assert (data->dirstreams[data->actdir] == NULL);
21
if (dfdp != NULL && *dfdp != -1)
23
int fd = openat64_not_cancel_3 (*dfdp, data->dirbuf + data->ftw.base,
25
close_not_cancel_no_status (fd);
33
*((char *) __mempcpy (data->dirbuf + data->ftw.base, name, namlen)) = '\0';
37
if (dir->streamfd != -1)
38
statres = FXSTATAT (_STAT_VER, dir->streamfd, name, &st,
39
(data->flags & FTW_PHYS) ? AT_SYMLINK_NOFOLLOW : 0);
43
if ((data->flags & FTW_CHDIR) == 0)
50
if (dir->streamfd != -1)
51
statres = FXSTATAT (_STAT_VER, dir->streamfd, name, &st,
55
statres = LXSTAT (_STAT_VER, name, &st);
56
if (statres == 0 && S_ISLNK (st.st_mode))
60
@@ -1222,42 +1222,21 @@
61
allocated with alloca to be recycled. */
62
#if !defined _LIBC || !defined GLOB_ONLY_P
64
-__attribute_noinline__
65
-link_exists2_p (const char *dir, size_t dirlen, const char *fname,
71
+link_exists_p (const char *dir, size_t dirlen, const char *fname,
72
+ glob_t *pglob, int flags)
74
size_t fnamelen = strlen (fname);
75
char *fullname = (char *) __alloca (dirlen + 1 + fnamelen + 1);
81
mempcpy (mempcpy (mempcpy (fullname, dir, dirlen), "/", 1),
85
- return (*pglob->gl_stat) (fullname, &st) == 0;
87
return ((__builtin_expect (flags & GLOB_ALTDIRFUNC, 0)
88
? (*pglob->gl_stat) (fullname, &st)
89
: __stat64 (fullname, &st64)) == 0);
93
-# define link_exists_p(dfd, dirname, dirnamelen, fname, pglob, flags) \
94
- (__builtin_expect (flags & GLOB_ALTDIRFUNC, 0) \
95
- ? link_exists2_p (dirname, dirnamelen, fname, pglob) \
96
- : ({ struct stat64 st64; \
97
- __fxstatat64 (_STAT_VER, dfd, fname, &st64, 0) == 0; }))
99
-# define link_exists_p(dfd, dirname, dirnamelen, fname, pglob, flags) \
100
- link_exists2_p (dirname, dirnamelen, fname, pglob, flags)
105
@@ -1332,10 +1311,6 @@
110
- int dfd = (__builtin_expect (flags & GLOB_ALTDIRFUNC, 0)
111
- ? -1 : dirfd ((DIR *) stream));
113
int fnm_flags = ((!(flags & GLOB_PERIOD) ? FNM_PERIOD : 0)
114
| ((flags & GLOB_NOESCAPE) ? FNM_NOESCAPE : 0)
115
#if defined _AMIGA || defined VMS
116
@@ -1394,7 +1369,7 @@
117
/* If the file we found is a symlink we have to
118
make sure the target file exists. */
119
if (!DIRENT_MIGHT_BE_SYMLINK (d)
120
- || link_exists_p (dfd, directory, dirlen, name, pglob,
121
+ || link_exists_p (directory, dirlen, name, pglob,
124
if (cur == names->count)