summaryrefslogtreecommitdiff
path: root/Kernel/Syscalls/execve.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-09-06 19:24:54 +0200
committerAndreas Kling <kling@serenityos.org>2021-09-06 19:25:36 +0200
commit56a2594de7fdcd1b0e8c2a20832ba4a14fa20501 (patch)
treec5da30fe55661c18aad37208fc073d5180793f8f /Kernel/Syscalls/execve.cpp
parent69b9b2888cea47393461799746e80a04bdcae4d1 (diff)
downloadserenity-56a2594de7fdcd1b0e8c2a20832ba4a14fa20501.zip
Kernel: Make KString factories return KResultOr + use TRY() everywhere
There are a number of places that don't have an error propagation path right now, so I've added FIXME's about that.
Diffstat (limited to 'Kernel/Syscalls/execve.cpp')
-rw-r--r--Kernel/Syscalls/execve.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/Kernel/Syscalls/execve.cpp b/Kernel/Syscalls/execve.cpp
index 8545e3ddee..67004f20d1 100644
--- a/Kernel/Syscalls/execve.cpp
+++ b/Kernel/Syscalls/execve.cpp
@@ -475,9 +475,7 @@ KResult Process::do_exec(NonnullRefPtr<FileDescription> main_program_description
return ENOENT;
auto new_process_name = parts.take_last();
- auto new_main_thread_name = KString::try_create(new_process_name);
- if (!new_main_thread_name)
- return ENOMEM;
+ auto new_main_thread_name = TRY(KString::try_create(new_process_name));
auto main_program_metadata = main_program_description->metadata();
@@ -598,7 +596,7 @@ KResult Process::do_exec(NonnullRefPtr<FileDescription> main_program_description
// NOTE: Be careful to not trigger any page faults below!
m_name = move(new_process_name);
- new_main_thread->set_name(new_main_thread_name.release_nonnull());
+ new_main_thread->set_name(move(new_main_thread_name));
{
ProtectedDataMutationScope scope { *this };