mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 18:32:28 -05:00
Kernel: Use TRY() in sys$chdir()
This commit is contained in:
parent
5ba10c6017
commit
f2f5df793a
1 changed files with 2 additions and 7 deletions
|
@ -14,13 +14,8 @@ KResultOr<FlatPtr> Process::sys$chdir(Userspace<const char*> user_path, size_t p
|
|||
{
|
||||
VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this);
|
||||
REQUIRE_PROMISE(rpath);
|
||||
auto path = get_syscall_path_argument(user_path, path_length);
|
||||
if (path.is_error())
|
||||
return path.error();
|
||||
auto directory_or_error = VirtualFileSystem::the().open_directory(path.value()->view(), current_directory());
|
||||
if (directory_or_error.is_error())
|
||||
return directory_or_error.error();
|
||||
m_cwd = *directory_or_error.value();
|
||||
auto path = TRY(get_syscall_path_argument(user_path, path_length));
|
||||
m_cwd = TRY(VirtualFileSystem::the().open_directory(path->view(), current_directory()));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue