diff options
Diffstat (limited to 'Kernel/Syscalls/get_dir_entries.cpp')
-rw-r--r-- | Kernel/Syscalls/get_dir_entries.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/Kernel/Syscalls/get_dir_entries.cpp b/Kernel/Syscalls/get_dir_entries.cpp index 49e0fba98e..604ab58af1 100644 --- a/Kernel/Syscalls/get_dir_entries.cpp +++ b/Kernel/Syscalls/get_dir_entries.cpp @@ -9,7 +9,7 @@ namespace Kernel { -KResultOr<FlatPtr> Process::sys$get_dir_entries(int fd, Userspace<void*> user_buffer, size_t user_size) +ErrorOr<FlatPtr> Process::sys$get_dir_entries(int fd, Userspace<void*> user_buffer, size_t user_size) { VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this); REQUIRE_PROMISE(stdio); @@ -19,11 +19,8 @@ KResultOr<FlatPtr> Process::sys$get_dir_entries(int fd, Userspace<void*> user_bu auto buffer = UserOrKernelBuffer::for_user_buffer(user_buffer, static_cast<size_t>(user_size)); if (!buffer.has_value()) return EFAULT; - auto result = description->get_dir_entries(buffer.value(), user_size); - if (result.is_error()) - return result.error(); - else - return result.release_value(); + auto count = TRY(description->get_dir_entries(buffer.value(), user_size)); + return count; } } |