diff options
author | Andreas Kling <kling@serenityos.org> | 2021-09-06 19:24:54 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-09-06 19:25:36 +0200 |
commit | 56a2594de7fdcd1b0e8c2a20832ba4a14fa20501 (patch) | |
tree | c5da30fe55661c18aad37208fc073d5180793f8f /Kernel/Process.cpp | |
parent | 69b9b2888cea47393461799746e80a04bdcae4d1 (diff) | |
download | serenity-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/Process.cpp')
-rw-r--r-- | Kernel/Process.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp index 23e095d047..cbe5faebf1 100644 --- a/Kernel/Process.cpp +++ b/Kernel/Process.cpp @@ -864,11 +864,9 @@ KResult Process::set_coredump_property(NonnullOwnPtr<KString> key, NonnullOwnPtr KResult Process::try_set_coredump_property(StringView key, StringView value) { - auto key_kstring = KString::try_create(key); - auto value_kstring = KString::try_create(value); - if (key_kstring && value_kstring) - return set_coredump_property(key_kstring.release_nonnull(), value_kstring.release_nonnull()); - return ENOMEM; + auto key_kstring = TRY(KString::try_create(key)); + auto value_kstring = TRY(KString::try_create(value)); + return set_coredump_property(move(key_kstring), move(value_kstring)); }; static constexpr StringView to_string(Pledge promise) |