mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
Kernel: Opening a file with O_TRUNC should update mtime
This commit is contained in:
parent
e485667201
commit
d310cf3b49
Notes:
sideshowbarker
2024-07-19 10:15:43 +09:00
Author: https://github.com/awesomekling
Commit: d310cf3b49
1 changed files with 3 additions and 1 deletions
|
@ -238,8 +238,10 @@ KResultOr<NonnullRefPtr<FileDescription>> VFS::open(StringView path, int options
|
||||||
descriptor_or_error.value()->set_original_inode({}, inode);
|
descriptor_or_error.value()->set_original_inode({}, inode);
|
||||||
return descriptor_or_error;
|
return descriptor_or_error;
|
||||||
}
|
}
|
||||||
if (should_truncate_file)
|
if (should_truncate_file) {
|
||||||
inode.truncate(0);
|
inode.truncate(0);
|
||||||
|
inode.set_mtime(kgettimeofday().tv_sec);
|
||||||
|
}
|
||||||
return FileDescription::create(custody);
|
return FileDescription::create(custody);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue