From bb54908866986dc1578e3077b323bfc1cc5aecba Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 2 Mar 2006 16:33:18 +0000 Subject: [PATCH] * io/ftw.c (process_entry): If dir->streamfd != -1, use FXSTATAT rather than LXSTAT to find if unstatable file is a dead symlink. --- ChangeLog | 6 +++++- io/ftw.c | 19 ++++++++++++++----- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index e6965f3c21..a91e3e456f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,8 @@ -006-03-02 Jakub Jelinek +2006-03-02 Jakub Jelinek + + * io/ftw.c (process_entry): If dir->streamfd != -1, + use FXSTATAT rather than LXSTAT to find if unstatable + file is a dead symlink. * elf/check-textrel.c: Include config.h. (AB(handle_file)): Don't fail if PF_X | PF_W on architectures known diff --git a/io/ftw.c b/io/ftw.c index 50303d9cd0..e96076a203 100644 --- a/io/ftw.c +++ b/io/ftw.c @@ -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 { -- 2.11.4.GIT