summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Kernel/FileSystem/DevPtsFS.cpp4
-rw-r--r--Kernel/FileSystem/DevPtsFS.h3
2 files changed, 4 insertions, 3 deletions
diff --git a/Kernel/FileSystem/DevPtsFS.cpp b/Kernel/FileSystem/DevPtsFS.cpp
index 2290449b29..7c84db9f0b 100644
--- a/Kernel/FileSystem/DevPtsFS.cpp
+++ b/Kernel/FileSystem/DevPtsFS.cpp
@@ -145,11 +145,9 @@ KResultOr<NonnullRefPtr<Inode>> DevPtsFSInode::lookup(StringView name)
if (name == "." || name == "..")
return *this;
- auto& fs = static_cast<DevPtsFS&>(this->fs());
-
auto pty_index = name.to_uint();
if (pty_index.has_value() && s_ptys->contains(pty_index.value())) {
- auto inode = fs.get_inode({ fsid(), pty_index_to_inode_index(pty_index.value()) });
+ auto inode = fs().get_inode({ fsid(), pty_index_to_inode_index(pty_index.value()) });
if (!inode)
return ENOENT;
return inode.release_nonnull();
diff --git a/Kernel/FileSystem/DevPtsFS.h b/Kernel/FileSystem/DevPtsFS.h
index 9efbb3ba00..568b2c2ca4 100644
--- a/Kernel/FileSystem/DevPtsFS.h
+++ b/Kernel/FileSystem/DevPtsFS.h
@@ -43,6 +43,9 @@ class DevPtsFSInode final : public Inode {
public:
virtual ~DevPtsFSInode() override;
+ DevPtsFS& fs() { return static_cast<DevPtsFS&>(Inode::fs()); }
+ DevPtsFS const& fs() const { return static_cast<DevPtsFS const&>(Inode::fs()); }
+
private:
DevPtsFSInode(DevPtsFS&, InodeIndex, SlavePTY*);