mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:27:45 +00:00
Kernel: Make KBuffer::try_create_with_bytes() return KResultOr
This commit is contained in:
parent
899cee8185
commit
250b52d6e5
8 changed files with 16 additions and 24 deletions
|
@ -27,9 +27,7 @@ KResultOr<FlatPtr> Process::sys$module_load(Userspace<const char*> user_path, si
|
|||
auto description = TRY(VirtualFileSystem::the().open(path->view(), O_RDONLY, 0, current_directory()));
|
||||
auto payload = TRY(description->read_entire_file());
|
||||
|
||||
auto storage = KBuffer::try_create_with_bytes(ReadonlyBytes { payload->data(), payload->size() });
|
||||
if (!storage)
|
||||
return ENOMEM;
|
||||
auto storage = TRY(KBuffer::try_create_with_bytes(ReadonlyBytes { payload->data(), payload->size() }));
|
||||
|
||||
auto elf_image = try_make<ELF::Image>(storage->data(), storage->size());
|
||||
if (!elf_image)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue