diff options
author | Andreas Kling <awesomekling@gmail.com> | 2020-01-08 13:56:49 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2020-01-08 15:21:06 +0100 |
commit | e48566720146e0c843554d2d474d7e5dad03b64d (patch) | |
tree | 0a9d782b73e96b574dc195eb1f3ab5f8902966af /Kernel/FileSystem | |
parent | 1f6c624a1ab66782fd157f9baa9c9e5a6a1bb76b (diff) | |
download | serenity-e48566720146e0c843554d2d474d7e5dad03b64d.zip |
Kernel: ftruncate() should update mtime
Diffstat (limited to 'Kernel/FileSystem')
-rw-r--r-- | Kernel/FileSystem/InodeFile.cpp | 8 |
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) |