mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
Kernel: Plumb OOM propagation through Custody factory
Modify the Custody::create(..) API so it has the ability to propagate OOM back to the caller.
This commit is contained in:
parent
fb93535419
commit
0b7395848a
Notes:
sideshowbarker
2024-07-18 18:23:22 +09:00
Author: https://github.com/bgianfo
Commit: 0b7395848a
Pull-request: https://github.com/SerenityOS/serenity/pull/7004
3 changed files with 27 additions and 7 deletions
|
@ -25,7 +25,12 @@ KResultOr<int> Process::sys$chroot(Userspace<const char*> user_path, size_t path
|
|||
auto directory = directory_or_error.value();
|
||||
m_root_directory_relative_to_global_root = directory;
|
||||
int chroot_mount_flags = mount_flags == -1 ? directory->mount_flags() : mount_flags;
|
||||
set_root_directory(Custody::create(nullptr, "", directory->inode(), chroot_mount_flags));
|
||||
|
||||
auto custody = Custody::create(nullptr, "", directory->inode(), chroot_mount_flags);
|
||||
if (custody.is_error())
|
||||
return custody.error();
|
||||
|
||||
set_root_directory(custody.release_value());
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue