mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-08 12:56:23 +03:00
Kernel: Make ftruncate
change st_ctime
as per spec
Previously we only modified `st_mtime` but the spec tells us to do both: https://pubs.opengroup.org/onlinepubs/007908799/xsh/ftruncate.html
This commit is contained in:
parent
751185cb76
commit
32b07f7057
Notes:
sideshowbarker
2024-07-17 07:19:27 +09:00
Author: https://github.com/fdellwing Commit: https://github.com/SerenityOS/serenity/commit/32b07f7057 Pull-request: https://github.com/SerenityOS/serenity/pull/23164 Reviewed-by: https://github.com/gmta
@ -96,7 +96,8 @@ 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()));
|
||||
auto truncated_at = kgettimeofday();
|
||||
TRY(m_inode->update_timestamps({}, truncated_at, truncated_at));
|
||||
return {};
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user