mirror of git://sourceware.org/git/glibc.git
(ftw_dir): Handle inaccessibility of toplevel dir different than implemented in last patch.
This commit is contained in:
parent
79dbd98195
commit
0e24e73d6d
7
io/ftw.c
7
io/ftw.c
|
@ -473,9 +473,6 @@ ftw_startup (const char *dir, int is_nftw, void *func, int descriptors,
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (__access (dir, R_OK) != 0)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
data.maxdir = descriptors < 1 ? 1 : descriptors;
|
data.maxdir = descriptors < 1 ? 1 : descriptors;
|
||||||
data.actdir = 0;
|
data.actdir = 0;
|
||||||
data.dirstreams = (struct dir_data **) alloca (data.maxdir
|
data.dirstreams = (struct dir_data **) alloca (data.maxdir
|
||||||
|
@ -552,9 +549,7 @@ ftw_startup (const char *dir, int is_nftw, void *func, int descriptors,
|
||||||
? LXSTAT (_STAT_VER, data.dirbuf, &st)
|
? LXSTAT (_STAT_VER, data.dirbuf, &st)
|
||||||
: XSTAT (_STAT_VER, data.dirbuf, &st)) < 0)
|
: XSTAT (_STAT_VER, data.dirbuf, &st)) < 0)
|
||||||
{
|
{
|
||||||
if (errno == EACCES)
|
if (!(flags & FTW_PHYS)
|
||||||
result = (*data.func) (data.dirbuf, &st, FTW_NS, &data.ftw);
|
|
||||||
else if (!(flags & FTW_PHYS)
|
|
||||||
&& errno == ENOENT
|
&& errno == ENOENT
|
||||||
&& LXSTAT (_STAT_VER, dir, &st) == 0
|
&& LXSTAT (_STAT_VER, dir, &st) == 0
|
||||||
&& S_ISLNK (st.st_mode))
|
&& S_ISLNK (st.st_mode))
|
||||||
|
|
Loading…
Reference in New Issue