This is an archive of the discontinued LLVM Phabricator instance.

FileSystem::EnumerateDirectory should keep iterating if one entry has an invalid Status
ClosedPublic

Authored by jasonmolenda on Jun 26 2023, 5:16 PM.

Details

Summary

EnumerateDirectory gets the vfs::Status of each file entry, to check if we are asked to report on this file type, and if we can't get the Status, it stops the directory search. Instead, if it can't get the Status of a directory entry, it should skip that entry and continue searching.

This happens with a broken symlink - the link points to another file, but that file doesn't exist, and the Status returned is of the destination file. When we can't get the destination file Status, an error code is returned.

Add a test case to FileSystemTests unittest.

Diff Detail

Event Timeline

jasonmolenda created this revision.Jun 26 2023, 5:16 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 26 2023, 5:16 PM
jasonmolenda requested review of this revision.Jun 26 2023, 5:16 PM
JDevlieghere accepted this revision.Jun 26 2023, 5:17 PM

LGTM modulo capitalization.

lldb/unittests/Host/FileSystemTest.cpp
54

Comments should start with a capital.

This revision is now accepted and ready to land.Jun 26 2023, 5:17 PM