mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 19:59:17 +00:00
Kernel: Make Inode::directory_entry_count errors observable.
Certain implementations of Inode::directory_entry_count were calling functions which returned errors, but had no way of surfacing them. Switch the return type to KResultOr<size_t> and start observing these error paths.
This commit is contained in:
parent
7490ea9449
commit
e8c9b5e870
Notes:
sideshowbarker
2024-07-19 04:17:38 +09:00
Author: https://github.com/bgianfo
Commit: e8c9b5e870
Pull-request: https://github.com/SerenityOS/serenity/pull/2999
12 changed files with 29 additions and 17 deletions
|
@ -794,13 +794,17 @@ void Plan9FSInode::flush_metadata()
|
|||
// Do nothing.
|
||||
}
|
||||
|
||||
size_t Plan9FSInode::directory_entry_count() const
|
||||
KResultOr<size_t> Plan9FSInode::directory_entry_count() const
|
||||
{
|
||||
size_t count = 0;
|
||||
traverse_as_directory([&count](const FS::DirectoryEntry&) {
|
||||
KResult result = traverse_as_directory([&count](const FS::DirectoryEntry&) {
|
||||
count++;
|
||||
return true;
|
||||
});
|
||||
|
||||
if (result.is_error())
|
||||
return result;
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue