diff options
author | Liav A <liavalb@gmail.com> | 2021-06-23 15:59:34 +0300 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-06-29 20:53:59 +0200 |
commit | 1f98d7d6387112463b636e522e265daadaeb1d7b (patch) | |
tree | ad22155f926ef2e9e8314b713d027abe5fa79f1f /Kernel/FileSystem | |
parent | d79d9e833ecc551e63f4caf4f114206faeafae4f (diff) | |
download | serenity-1f98d7d6387112463b636e522e265daadaeb1d7b.zip |
Kernel/ProcFS: Tighten modified time value across the filesystem objects
It didn't make any sense to hardcode the modified time of all created
inodes with "mepoch", so we should query the procfs "backend" to get
the modified time value.
Since ProcFS is dynamically changed all the time, the modified time
equals to the querying time.
This could be changed if desired, by making the modified_time()
method virtual and overriding it in different procfs-backed objects :)
Diffstat (limited to 'Kernel/FileSystem')
-rw-r--r-- | Kernel/FileSystem/ProcFS.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Kernel/FileSystem/ProcFS.cpp b/Kernel/FileSystem/ProcFS.cpp index 4f5cd3968b..e90b96d064 100644 --- a/Kernel/FileSystem/ProcFS.cpp +++ b/Kernel/FileSystem/ProcFS.cpp @@ -145,7 +145,7 @@ InodeMetadata ProcFSInode::metadata() const metadata.uid = m_associated_component->owner_user(); metadata.gid = m_associated_component->owner_group(); metadata.size = m_associated_component->size(); - metadata.mtime = mepoch; + metadata.mtime = m_associated_component->modified_time(); return metadata; } @@ -216,7 +216,7 @@ InodeMetadata ProcFSDirectoryInode::metadata() const metadata.uid = m_associated_component->owner_user(); metadata.gid = m_associated_component->owner_group(); metadata.size = 0; - metadata.mtime = mepoch; + metadata.mtime = m_associated_component->modified_time(); return metadata; } KResult ProcFSDirectoryInode::traverse_as_directory(Function<bool(const FS::DirectoryEntryView&)> callback) const @@ -258,7 +258,7 @@ InodeMetadata ProcFSLinkInode::metadata() const metadata.uid = m_associated_component->owner_user(); metadata.gid = m_associated_component->owner_group(); metadata.size = 0; - metadata.mtime = mepoch; + metadata.mtime = m_associated_component->modified_time(); return metadata; } |