summaryrefslogtreecommitdiff
path: root/Kernel/Syscalls
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-05-28 11:23:00 +0200
committerAndreas Kling <kling@serenityos.org>2021-05-28 11:23:00 +0200
commit9d801d2345581f9524ae61f93e4e3785249ae0e4 (patch)
tree489129173def8cc9a9c10b69419e6bbd75b7bf6b /Kernel/Syscalls
parent9a827ad3da16aafd8ef47efefd5b18ca2fb1f07b (diff)
downloadserenity-9d801d2345581f9524ae61f93e4e3785249ae0e4.zip
Kernel: Rename Custody::create() => try_create()
The try_ prefix indicates that this may fail. :^)
Diffstat (limited to 'Kernel/Syscalls')
-rw-r--r--Kernel/Syscalls/chroot.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/Kernel/Syscalls/chroot.cpp b/Kernel/Syscalls/chroot.cpp
index 089d98fe25..4d6a63747c 100644
--- a/Kernel/Syscalls/chroot.cpp
+++ b/Kernel/Syscalls/chroot.cpp
@@ -26,11 +26,11 @@ KResultOr<int> Process::sys$chroot(Userspace<const char*> user_path, size_t path
m_root_directory_relative_to_global_root = directory;
int chroot_mount_flags = mount_flags == -1 ? directory->mount_flags() : mount_flags;
- auto custody = Custody::create(nullptr, "", directory->inode(), chroot_mount_flags);
- if (custody.is_error())
- return custody.error();
+ auto custody_or_error = Custody::try_create(nullptr, "", directory->inode(), chroot_mount_flags);
+ if (custody_or_error.is_error())
+ return custody_or_error.error();
- set_root_directory(custody.release_value());
+ set_root_directory(custody_or_error.release_value());
return 0;
}