diff options
author | Ulrich Drepper <drepper@redhat.com> | 2006-03-02 16:33:18 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2006-03-02 16:33:18 +0000 |
commit | bb54908866986dc1578e3077b323bfc1cc5aecba (patch) | |
tree | f7619be5e1d19ce9e07308db4f07de4b874229c1 /io/ftw.c | |
parent | 70c50602ccaedc74b25fbaef96a7a4e6eeb407a2 (diff) | |
download | glibc-bb54908866986dc1578e3077b323bfc1cc5aecba.zip glibc-bb54908866986dc1578e3077b323bfc1cc5aecba.tar.gz glibc-bb54908866986dc1578e3077b323bfc1cc5aecba.tar.bz2 |
* io/ftw.c (process_entry): If dir->streamfd != -1,
use FXSTATAT rather than LXSTAT to find if unstatable
file is a dead symlink.
Diffstat (limited to 'io/ftw.c')
-rw-r--r-- | io/ftw.c | 19 |
1 files changed, 14 insertions, 5 deletions
@@ -419,13 +419,22 @@ process_entry (struct ftw_data *data, struct dir_data *dir, const char *name, { if (errno != EACCES && errno != ENOENT) result = -1; - else if (!(data->flags & FTW_PHYS) - && (d_type == DT_LNK - || (LXSTAT (_STAT_VER, name, &st) == 0 - && S_ISLNK (st.st_mode)))) + else if (data->flags & FTW_PHYS) + flag = FTW_NS; + else if (d_type == DT_LNK) flag = FTW_SLN; else - flag = FTW_NS; + { + if (dir->streamfd != -1) + statres = FXSTATAT (_STAT_VER, dir->streamfd, name, &st, + AT_SYMLINK_NOFOLLOW); + else + statres = LXSTAT (_STAT_VER, name, &st); + if (statres == 0 && S_ISLNK (st.st_mode)) + flag = FTW_SLN; + else + flag = FTW_NS; + } } else { |