mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:57:43 +00:00
Kernel: Tidy up AnonymousFile construction a bit
- Rename create() => try_create() - Use adopt_nonnull_ref_or_enomem()
This commit is contained in:
parent
9a1fdb523f
commit
4012099338
2 changed files with 6 additions and 6 deletions
|
@ -33,10 +33,10 @@ KResultOr<FlatPtr> Process::sys$anon_create(size_t size, int options)
|
|||
if (maybe_vmobject.is_error())
|
||||
return maybe_vmobject.error();
|
||||
|
||||
auto anon_file = AnonymousFile::create(maybe_vmobject.release_value());
|
||||
if (!anon_file)
|
||||
return ENOMEM;
|
||||
auto description_or_error = FileDescription::try_create(*anon_file);
|
||||
auto anon_file_or_error = AnonymousFile::try_create(maybe_vmobject.release_value());
|
||||
if (anon_file_or_error.is_error())
|
||||
return anon_file_or_error.error();
|
||||
auto description_or_error = FileDescription::try_create(anon_file_or_error.release_value());
|
||||
if (description_or_error.is_error())
|
||||
return description_or_error.error();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue