1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 12:38:12 +00:00

Kernel: Use symbolic constants for file modes

This fixes a bug where the mode of a FIFO was reported as 001000 instead
of 0010000 (you see the difference? me nethier), and hopefully doesn't
introduce new bugs. I've left 0777 and similar in a few places, because
that is *more* readable than its symbolic version.
This commit is contained in:
Sergey Bugaev 2020-06-16 22:03:51 +03:00 committed by Andreas Kling
parent fd985b1f48
commit e0d0d52455
5 changed files with 52 additions and 30 deletions

View file

@ -78,12 +78,12 @@ KResult FileDescription::fstat(stat& buffer)
{
if (is_fifo()) {
memset(&buffer, 0, sizeof(buffer));
buffer.st_mode = 001000;
buffer.st_mode = S_IFIFO;
return KSuccess;
}
if (is_socket()) {
memset(&buffer, 0, sizeof(buffer));
buffer.st_mode = 0140000;
buffer.st_mode = S_IFSOCK;
return KSuccess;
}