mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 15:38:10 +00:00
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.
This commit is contained in:
parent
69b9b2888c
commit
56a2594de7
21 changed files with 100 additions and 122 deletions
|
@ -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 };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue