1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:57:45 +00:00

Kernel: Remove KBuffer::try_copy() in favor of try_create_with_bytes()

These were already equivalent, so let's only have one of them.
This commit is contained in:
Andreas Kling 2021-09-07 16:22:29 +02:00
parent 8ded4ad88c
commit a01b19c878
3 changed files with 2 additions and 7 deletions

View file

@ -45,7 +45,7 @@ KResultOr<FlatPtr> Process::sys$module_load(Userspace<const char*> user_path, si
elf_image->for_each_section_of_type(SHT_PROGBITS, [&](const ELF::Image::Section& section) {
if (!section.size() || !section_loading_result.is_error())
return;
auto section_storage_or_error = KBuffer::try_copy(section.raw_data(), section.size(), Memory::Region::Access::ReadWriteExecute);
auto section_storage_or_error = KBuffer::try_create_with_bytes(ReadonlyBytes { section.raw_data(), section.size() }, Memory::Region::Access::ReadWriteExecute);
if (section_storage_or_error.is_error()) {
section_loading_result = section_storage_or_error.error();
return;