mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 10:48:41 +00:00
Kernel: Propagate a few KResults properly in FileSystem subsystems
Propagating un-obsevered KResults up the stack.
This commit is contained in:
committed by
Andreas Kling
parent
c4c6d9367d
commit
d67069d922
@@ -191,9 +191,9 @@ bool VFS::is_vfs_root(InodeIdentifier inode) const
|
||||
return inode == root_inode_id();
|
||||
}
|
||||
|
||||
void VFS::traverse_directory_inode(Inode& dir_inode, Function<bool(const FS::DirectoryEntry&)> callback)
|
||||
KResult VFS::traverse_directory_inode(Inode& dir_inode, Function<bool(const FS::DirectoryEntry&)> callback)
|
||||
{
|
||||
dir_inode.traverse_as_directory([&](const FS::DirectoryEntry& entry) {
|
||||
return dir_inode.traverse_as_directory([&](const FS::DirectoryEntry& entry) {
|
||||
InodeIdentifier resolved_inode;
|
||||
if (auto mount = find_mount_for_host(entry.inode))
|
||||
resolved_inode = mount->guest().identifier();
|
||||
@@ -329,7 +329,9 @@ KResultOr<NonnullRefPtr<FileDescription>> VFS::open(StringView path, int options
|
||||
return KResult(-EROFS);
|
||||
|
||||
if (should_truncate_file) {
|
||||
inode.truncate(0);
|
||||
KResult result = inode.truncate(0);
|
||||
if (result.is_error())
|
||||
return result;
|
||||
inode.set_mtime(kgettimeofday().tv_sec);
|
||||
}
|
||||
auto description = FileDescription::create(custody);
|
||||
|
||||
Reference in New Issue
Block a user