summaryrefslogtreecommitdiff
path: root/Kernel/Syscalls/waitid.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-09-05 18:42:32 +0200
committerAndreas Kling <kling@serenityos.org>2021-09-05 18:42:32 +0200
commit12d9a6c1fa31852d9269630cd7a3c0c5e6f4cc16 (patch)
tree716c416d890a7eb83cf4a6c6be6baeac77fd9b82 /Kernel/Syscalls/waitid.cpp
parentc076d765c4321f1beed6a0bbd11dd652b1ece272 (diff)
downloadserenity-12d9a6c1fa31852d9269630cd7a3c0c5e6f4cc16.zip
Kernel: Use TRY() in sys$waitid()
Diffstat (limited to 'Kernel/Syscalls/waitid.cpp')
-rw-r--r--Kernel/Syscalls/waitid.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/Kernel/Syscalls/waitid.cpp b/Kernel/Syscalls/waitid.cpp
index 350f95b1c1..de0948745e 100644
--- a/Kernel/Syscalls/waitid.cpp
+++ b/Kernel/Syscalls/waitid.cpp
@@ -52,11 +52,8 @@ KResultOr<FlatPtr> Process::sys$waitid(Userspace<const Syscall::SC_waitid_params
dbgln_if(PROCESS_DEBUG, "sys$waitid({}, {}, {}, {})", params.idtype, params.id, params.infop, params.options);
- auto siginfo_or_error = do_waitid(move(waitee), params.options);
- if (siginfo_or_error.is_error())
- return siginfo_or_error.error();
-
- return copy_to_user(params.infop, &siginfo_or_error.value());
+ auto siginfo = TRY(do_waitid(move(waitee), params.options));
+ return copy_to_user(params.infop, &siginfo);
}
}