1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 09:57:35 +00:00

LibCore: Fall back to fstat if readdir doesn't produce a valid file type

Per POSIX, It is valid for dirent structures obtained via readdir to
not name a valid type.
This commit is contained in:
implicitfield 2024-01-03 17:06:51 +04:00 committed by Ali Mohammad Pur
parent 48e848a9fd
commit 7c9ca8baab
3 changed files with 16 additions and 1 deletions

View file

@ -28,6 +28,7 @@ struct DirectoryEntry {
ByteString name;
ino_t inode_number;
static Type directory_entry_type_from_stat(mode_t st_mode);
static DirectoryEntry from_dirent(dirent const&);
static DirectoryEntry from_stat(DIR*, dirent const&);
};