mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-06 16:19:23 +00: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: 32b07f7057
Pull-request: https://github.com/SerenityOS/serenity/pull/23164
Reviewed-by: https://github.com/gmta
1 changed files with 2 additions and 1 deletions
|
@ -96,7 +96,8 @@ ErrorOr<NonnullOwnPtr<KString>> InodeFile::pseudo_path(OpenFileDescription const
|
||||||
ErrorOr<void> InodeFile::truncate(u64 size)
|
ErrorOr<void> InodeFile::truncate(u64 size)
|
||||||
{
|
{
|
||||||
TRY(m_inode->truncate(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 {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue