mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-26 19:32:06 -05: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:
parent
b545427d53
commit
7edc69dc94
1 changed files with 1 additions and 1 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Reference in a new issue