diff options
Diffstat (limited to 'Kernel/Bus/USB')
-rw-r--r-- | Kernel/Bus/USB/SysFSUSB.cpp | 8 | ||||
-rw-r--r-- | Kernel/Bus/USB/SysFSUSB.h | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/Kernel/Bus/USB/SysFSUSB.cpp b/Kernel/Bus/USB/SysFSUSB.cpp index d242c8cb85..ecb64f352e 100644 --- a/Kernel/Bus/USB/SysFSUSB.cpp +++ b/Kernel/Bus/USB/SysFSUSB.cpp @@ -91,17 +91,17 @@ ErrorOr<size_t> SysFSUSBDeviceInformation::read_bytes(off_t offset, size_t count return nread; } -ErrorOr<void> SysFSUSBBusDirectory::traverse_as_directory(unsigned fsid, Function<bool(FileSystem::DirectoryEntryView const&)> callback) const +ErrorOr<void> SysFSUSBBusDirectory::traverse_as_directory(unsigned fsid, Function<ErrorOr<void>(FileSystem::DirectoryEntryView const&)> callback) const { SpinlockLocker lock(m_lock); // Note: if the parent directory is null, it means something bad happened as this should not happen for the USB directory. VERIFY(m_parent_directory); - callback({ ".", { fsid, component_index() }, 0 }); - callback({ "..", { fsid, m_parent_directory->component_index() }, 0 }); + TRY(callback({ ".", { fsid, component_index() }, 0 })); + TRY(callback({ "..", { fsid, m_parent_directory->component_index() }, 0 })); for (auto& device_node : m_device_nodes) { InodeIdentifier identifier = { fsid, device_node.component_index() }; - callback({ device_node.name(), identifier, 0 }); + TRY(callback({ device_node.name(), identifier, 0 })); } return {}; } diff --git a/Kernel/Bus/USB/SysFSUSB.h b/Kernel/Bus/USB/SysFSUSB.h index 9891c87b13..ffb14a3740 100644 --- a/Kernel/Bus/USB/SysFSUSB.h +++ b/Kernel/Bus/USB/SysFSUSB.h @@ -46,7 +46,7 @@ public: void plug(USB::Device&); void unplug(USB::Device&); - virtual ErrorOr<void> traverse_as_directory(unsigned, Function<bool(FileSystem::DirectoryEntryView const&)>) const override; + virtual ErrorOr<void> traverse_as_directory(unsigned, Function<ErrorOr<void>(FileSystem::DirectoryEntryView const&)>) const override; virtual RefPtr<SysFSComponent> lookup(StringView name) override; private: |