mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:27:35 +00:00
Kernel: Use TRY() in sys$unlink()
This commit is contained in:
parent
4e4b7c272c
commit
de2c1bc5c3
1 changed files with 2 additions and 4 deletions
|
@ -14,10 +14,8 @@ KResultOr<FlatPtr> Process::sys$unlink(Userspace<const char*> user_path, size_t
|
||||||
{
|
{
|
||||||
VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this)
|
VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this)
|
||||||
REQUIRE_PROMISE(cpath);
|
REQUIRE_PROMISE(cpath);
|
||||||
auto path = get_syscall_path_argument(user_path, path_length);
|
auto path = TRY(get_syscall_path_argument(user_path, path_length));
|
||||||
if (path.is_error())
|
return VirtualFileSystem::the().unlink(path->view(), current_directory());
|
||||||
return path.error();
|
|
||||||
return VirtualFileSystem::the().unlink(path.value()->view(), current_directory());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue