summaryrefslogtreecommitdiff
path: root/Kernel/FileSystem/FileDescription.cpp
diff options
context:
space:
mode:
authorSergey Bugaev <bugaevc@serenityos.org>2020-06-16 22:03:51 +0300
committerAndreas Kling <kling@serenityos.org>2020-06-17 15:02:03 +0200
commite0d0d52455d44fa0688477ed9ff58c0677c9d400 (patch)
tree3611f70ef05c0d5fc34c6ec24029925283ed8ae5 /Kernel/FileSystem/FileDescription.cpp
parentfd985b1f48f832f526766b5d4ecf968d2e2a1425 (diff)
downloadserenity-e0d0d52455d44fa0688477ed9ff58c0677c9d400.zip
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.
Diffstat (limited to 'Kernel/FileSystem/FileDescription.cpp')
-rw-r--r--Kernel/FileSystem/FileDescription.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/FileSystem/FileDescription.cpp b/Kernel/FileSystem/FileDescription.cpp
index 4b76e4ca4a..c4c3f8f700 100644
--- a/Kernel/FileSystem/FileDescription.cpp
+++ b/Kernel/FileSystem/FileDescription.cpp
@@ -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;
}