diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-10-22 22:23:58 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-10-22 22:23:58 +0200 |
commit | 0782c60fe5294feda7b69fc3b51ffa046a3b3e9e (patch) | |
tree | 4d8b1756f79ebbf4e5a260ffcffc8176465b44fc /Kernel/FileSystem/InodeFile.cpp | |
parent | 708543c3d64c28d3c8d02d9b74d0921bf5f6c588 (diff) | |
download | serenity-0782c60fe5294feda7b69fc3b51ffa046a3b3e9e.zip |
Kernel: Update the mtime after a successful InodeFile::write()
Well this was pretty silly. We were not updating the modification time
of files.. after modifying them. :^)
Diffstat (limited to 'Kernel/FileSystem/InodeFile.cpp')
-rw-r--r-- | Kernel/FileSystem/InodeFile.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Kernel/FileSystem/InodeFile.cpp b/Kernel/FileSystem/InodeFile.cpp index 36ace74ab8..7ba9814019 100644 --- a/Kernel/FileSystem/InodeFile.cpp +++ b/Kernel/FileSystem/InodeFile.cpp @@ -20,7 +20,10 @@ ssize_t InodeFile::read(FileDescription& description, u8* buffer, ssize_t count) ssize_t InodeFile::write(FileDescription& description, const u8* data, ssize_t count) { - return m_inode->write_bytes(description.offset(), count, data, &description); + ssize_t ret = m_inode->write_bytes(description.offset(), count, data, &description); + if (ret > 0) + m_inode->set_mtime(kgettimeofday().tv_sec); + return ret; } KResultOr<Region*> InodeFile::mmap(Process& process, FileDescription& description, VirtualAddress preferred_vaddr, size_t offset, size_t size, int prot) |