summaryrefslogtreecommitdiff
path: root/Kernel/FileSystem
diff options
context:
space:
mode:
authorSpencer Dixon <spencercdixon@gmail.com>2021-05-05 15:07:13 -0400
committerGitHub <noreply@github.com>2021-05-05 21:07:13 +0200
commit2156c728cdd8e5a223d986869275a696ee2ef128 (patch)
tree993b5646fa83d55c415168e5a7f1b26e6cab957e /Kernel/FileSystem
parent773c17b6a0cb6cac1a40fccb6f285fe027497ff7 (diff)
downloadserenity-2156c728cdd8e5a223d986869275a696ee2ef128.zip
Kernel: Fix `write`s to `ProcFS` (#6879)
When using `sysctl` you can enable/disable values by writing to the ProcFS. Some drift must have occured where writing was failing due to a missing `set_mtime` call. Whenever one `write`'s a file the modified time (mtime) will be updated so we need to implement this interface in ProcFS.
Diffstat (limited to 'Kernel/FileSystem')
-rw-r--r--Kernel/FileSystem/ProcFS.cpp5
-rw-r--r--Kernel/FileSystem/ProcFS.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/Kernel/FileSystem/ProcFS.cpp b/Kernel/FileSystem/ProcFS.cpp
index 595f90d16a..8cbd49e493 100644
--- a/Kernel/FileSystem/ProcFS.cpp
+++ b/Kernel/FileSystem/ProcFS.cpp
@@ -1562,6 +1562,11 @@ KResultOr<NonnullRefPtr<Custody>> ProcFSInode::resolve_as_link(Custody& base, Re
return *res;
}
+KResult ProcFSInode::set_mtime(time_t)
+{
+ return KSuccess;
+}
+
ProcFSProxyInode::ProcFSProxyInode(ProcFS& fs, FileDescription& fd)
: Inode(fs, 0)
, m_fd(fd)
diff --git a/Kernel/FileSystem/ProcFS.h b/Kernel/FileSystem/ProcFS.h
index d8616eadb9..b54acbd0f7 100644
--- a/Kernel/FileSystem/ProcFS.h
+++ b/Kernel/FileSystem/ProcFS.h
@@ -90,6 +90,7 @@ private:
virtual KResult chmod(mode_t) override;
virtual KResult chown(uid_t, gid_t) override;
virtual KResultOr<NonnullRefPtr<Custody>> resolve_as_link(Custody& base, RefPtr<Custody>* out_parent = nullptr, int options = 0, int symlink_recursion_level = 0) const override;
+ virtual KResult set_mtime(time_t) override;
KResult refresh_data(FileDescription&) const;