mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +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:
parent
fd985b1f48
commit
e0d0d52455
Notes:
sideshowbarker
2024-07-19 05:36:29 +09:00
Author: https://github.com/bugaevc
Commit: e0d0d52455
Pull-request: https://github.com/SerenityOS/serenity/pull/2564
Reviewed-by: https://github.com/alimpfard
Reviewed-by: https://github.com/awesomekling
5 changed files with 52 additions and 30 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue