path: root/Documentation
diff options
authorLinus Torvalds <>2007-10-19 17:59:22 (GMT)
committerShawn O. Pearce <>2007-10-21 05:44:40 (GMT)
commit07134421fc5765d6c96c548e70e461c290143762 (patch)
treed6aa5c5143a710d756670069d38baee75ec0dd6d /Documentation
parent7468c297fa88f0035dc719e996b93b1404eee6e3 (diff)
Fix directory scanner to correctly ignore files without d_type
On Fri, 19 Oct 2007, Todd T. Fries wrote: > If DT_UNKNOWN exists, then we have to do a stat() of some form to > find out the right type. That happened in the case of a pathname that was ignored, and we did not ask for "dir->show_ignored". That test used to be *together* with the "DTYPE(de) != DT_DIR", but splitting the two tests up means that we can do that (common) test before we even bother to calculate the real dtype. Of course, that optimization only matters for systems that don't have, or don't fill in DTYPE properly. I also clarified the real relationship between "exclude" and "dir->show_ignored". It used to do if (exclude != dir->show_ignored) { .. which wasn't exactly obvious, because it triggers for two different cases: - the path is marked excluded, but we are not interested in ignored files: ignore it - the path is *not* excluded, but we *are* interested in ignored files: ignore it unless it's a directory, in which case we might have ignored files inside the directory and need to recurse into it). so this splits them into those two cases, since the first case doesn't even care about the type. I also made a the DT_UNKNOWN case a separate helper function, and added some commentary to the cases. Linus Signed-off-by: Shawn O. Pearce <>
Diffstat (limited to 'Documentation')
0 files changed, 0 insertions, 0 deletions