mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 08:38:12 +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
|
@ -282,11 +282,8 @@ KResult TmpFSInode::add_child(Inode& child, StringView const& name, mode_t)
|
|||
if (name.length() > NAME_MAX)
|
||||
return ENAMETOOLONG;
|
||||
|
||||
auto name_kstring = KString::try_create(name);
|
||||
if (!name_kstring)
|
||||
return ENOMEM;
|
||||
|
||||
auto* child_entry = new (nothrow) Child { name_kstring.release_nonnull(), static_cast<TmpFSInode&>(child) };
|
||||
auto name_kstring = TRY(KString::try_create(name));
|
||||
auto* child_entry = new (nothrow) Child { move(name_kstring), static_cast<TmpFSInode&>(child) };
|
||||
if (!child_entry)
|
||||
return ENOMEM;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue