1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 17:45:09 +00:00

Kernel: Propagate a few KResults properly in FileSystem subsystems

Propagating un-obsevered KResults up the stack.
This commit is contained in:
Brian Gianforcaro 2020-08-05 02:07:31 -07:00 committed by Andreas Kling
parent c4c6d9367d
commit d67069d922
5 changed files with 20 additions and 8 deletions

View file

@ -187,13 +187,17 @@ ssize_t FileDescription::get_dir_entries(u8* buffer, ssize_t size)
auto temp_buffer = ByteBuffer::create_uninitialized(size_to_allocate);
BufferStream stream(temp_buffer);
VFS::the().traverse_directory_inode(*m_inode, [&stream](auto& entry) {
KResult result = VFS::the().traverse_directory_inode(*m_inode, [&stream](auto& entry) {
stream << (u32)entry.inode.index();
stream << (u8)entry.file_type;
stream << (u32)entry.name_length;
stream << entry.name;
return true;
});
if (result.is_error())
result.error();
stream.snip();
if (static_cast<size_t>(size) < temp_buffer.size())