1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 00:07:43 +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

@ -9,7 +9,7 @@
namespace Core {
static DirectoryEntry::Type directory_entry_type_from_stat(mode_t st_mode)
DirectoryEntry::Type DirectoryEntry::directory_entry_type_from_stat(mode_t st_mode)
{
switch (st_mode & S_IFMT) {
case S_IFIFO: