summaryrefslogtreecommitdiff
path: root/Kernel/FileSystem
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2020-01-08 13:56:49 +0100
committerAndreas Kling <awesomekling@gmail.com>2020-01-08 15:21:06 +0100
commite48566720146e0c843554d2d474d7e5dad03b64d (patch)
tree0a9d782b73e96b574dc195eb1f3ab5f8902966af /Kernel/FileSystem
parent1f6c624a1ab66782fd157f9baa9c9e5a6a1bb76b (diff)
downloadserenity-e48566720146e0c843554d2d474d7e5dad03b64d.zip
Kernel: ftruncate() should update mtime
Diffstat (limited to 'Kernel/FileSystem')
-rw-r--r--Kernel/FileSystem/InodeFile.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/Kernel/FileSystem/InodeFile.cpp b/Kernel/FileSystem/InodeFile.cpp
index f3449498a8..852a450401 100644
--- a/Kernel/FileSystem/InodeFile.cpp
+++ b/Kernel/FileSystem/InodeFile.cpp
@@ -50,7 +50,13 @@ String InodeFile::absolute_path(const FileDescription& description) const
KResult InodeFile::truncate(off_t size)
{
- return m_inode->truncate(size);
+ auto truncate_result = m_inode->truncate(size);
+ if (truncate_result.is_error())
+ return truncate_result;
+ int mtime_result = m_inode->set_mtime(kgettimeofday().tv_sec);
+ if (mtime_result != 0)
+ return KResult(mtime_result);
+ return KSuccess;
}
KResult InodeFile::chown(uid_t uid, gid_t gid)