mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 10:54:57 +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
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)
|
||||
{
|
||||
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…
Add table
Add a link
Reference in a new issue