mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-02 06:09:08 +00:00
Kernel: Use TRY() in sys$utime()
This commit is contained in:
parent
789db813d3
commit
c5d046c23a
Notes:
sideshowbarker
2024-07-18 04:41:44 +09:00
Author: https://github.com/awesomekling
Commit: c5d046c23a
1 changed files with 2 additions and 4 deletions
|
@ -14,9 +14,7 @@ KResultOr<FlatPtr> Process::sys$utime(Userspace<const char*> user_path, size_t p
|
||||||
{
|
{
|
||||||
VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this)
|
VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this)
|
||||||
REQUIRE_PROMISE(fattr);
|
REQUIRE_PROMISE(fattr);
|
||||||
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 path.error();
|
|
||||||
utimbuf buf;
|
utimbuf buf;
|
||||||
if (user_buf) {
|
if (user_buf) {
|
||||||
TRY(copy_from_user(&buf, user_buf));
|
TRY(copy_from_user(&buf, user_buf));
|
||||||
|
@ -25,7 +23,7 @@ KResultOr<FlatPtr> Process::sys$utime(Userspace<const char*> user_path, size_t p
|
||||||
// Not a bug!
|
// Not a bug!
|
||||||
buf = { now, now };
|
buf = { now, now };
|
||||||
}
|
}
|
||||||
return VirtualFileSystem::the().utime(path.value()->view(), current_directory(), buf.actime, buf.modtime);
|
return VirtualFileSystem::the().utime(path->view(), current_directory(), buf.actime, buf.modtime);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue