mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 19:04:58 +00:00
Kernel: Opening a file with O_TRUNC should update mtime
This commit is contained in:
@@ -238,8 +238,10 @@ KResultOr<NonnullRefPtr<FileDescription>> VFS::open(StringView path, int options
|
||||
descriptor_or_error.value()->set_original_inode({}, inode);
|
||||
return descriptor_or_error;
|
||||
}
|
||||
if (should_truncate_file)
|
||||
if (should_truncate_file) {
|
||||
inode.truncate(0);
|
||||
inode.set_mtime(kgettimeofday().tv_sec);
|
||||
}
|
||||
return FileDescription::create(custody);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user