mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 04:41:56 +00:00
Kernel: Use AK::Time for InodeMetadata timestamps instead of time_t
Before this change, we were truncating the nanosecond part of file timestamps in many different places.
This commit is contained in:
parent
f8290e1ad4
commit
10fa72d451
Notes:
sideshowbarker
2024-07-17 04:10:17 +09:00
Author: https://github.com/awesomekling
Commit: 10fa72d451
Pull-request: https://github.com/SerenityOS/serenity/pull/16147
Reviewed-by: https://github.com/Hendiadyoin1
23 changed files with 56 additions and 58 deletions
|
@ -44,7 +44,7 @@ ErrorOr<size_t> InodeFile::write(OpenFileDescription& description, u64 offset, U
|
|||
|
||||
size_t nwritten = TRY(m_inode->write_bytes(offset, count, data, &description));
|
||||
if (nwritten > 0) {
|
||||
auto mtime_result = m_inode->update_timestamps({}, {}, kgettimeofday().to_truncated_seconds());
|
||||
auto mtime_result = m_inode->update_timestamps({}, {}, kgettimeofday());
|
||||
Thread::current()->did_file_write(nwritten);
|
||||
evaluate_block_conditions();
|
||||
if (mtime_result.is_error())
|
||||
|
@ -96,7 +96,7 @@ ErrorOr<NonnullOwnPtr<KString>> InodeFile::pseudo_path(OpenFileDescription const
|
|||
ErrorOr<void> InodeFile::truncate(u64 size)
|
||||
{
|
||||
TRY(m_inode->truncate(size));
|
||||
TRY(m_inode->update_timestamps({}, {}, kgettimeofday().to_truncated_seconds()));
|
||||
TRY(m_inode->update_timestamps({}, {}, kgettimeofday()));
|
||||
return {};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue