mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
LibCore: Ignore non-S_IFMT bits in directory_entry_type_from_stat
The st_mode field in struct stat is a bitfield of more than just the file type, this commit masks off the non-filetype bits to ensure no unrelated bits are checked.
This commit is contained in:
committed by
Andreas Kling
parent
b545427d53
commit
7edc69dc94
@@ -11,7 +11,7 @@ namespace Core {
|
||||
|
||||
static DirectoryEntry::Type directory_entry_type_from_stat(mode_t st_mode)
|
||||
{
|
||||
switch (st_mode) {
|
||||
switch (st_mode & S_IFMT) {
|
||||
case S_IFIFO:
|
||||
return DirectoryEntry::Type::NamedPipe;
|
||||
case S_IFCHR:
|
||||
|
||||
Reference in New Issue
Block a user