mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 09:57:34 +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:
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)
|
static DirectoryEntry::Type directory_entry_type_from_stat(mode_t st_mode)
|
||||||
{
|
{
|
||||||
switch (st_mode) {
|
switch (st_mode & S_IFMT) {
|
||||||
case S_IFIFO:
|
case S_IFIFO:
|
||||||
return DirectoryEntry::Type::NamedPipe;
|
return DirectoryEntry::Type::NamedPipe;
|
||||||
case S_IFCHR:
|
case S_IFCHR:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue