1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:07:47 +00:00

Kernel: Make all syscall functions return KResultOr<T>

This makes it a lot easier to return errors since we no longer have to
worry about negating EFOO errors and can just return them flat.
This commit is contained in:
Andreas Kling 2021-03-01 13:49:16 +01:00
parent 9af1e1a3bf
commit ac71775de5
70 changed files with 747 additions and 742 deletions

View file

@ -30,7 +30,7 @@
namespace Kernel {
int Process::sys$utime(Userspace<const char*> user_path, size_t path_length, Userspace<const struct utimbuf*> user_buf)
KResultOr<int> Process::sys$utime(Userspace<const char*> user_path, size_t path_length, Userspace<const struct utimbuf*> user_buf)
{
REQUIRE_PROMISE(fattr);
auto path = get_syscall_path_argument(user_path, path_length);
@ -39,7 +39,7 @@ int Process::sys$utime(Userspace<const char*> user_path, size_t path_length, Use
utimbuf buf;
if (user_buf) {
if (!copy_from_user(&buf, user_buf))
return -EFAULT;
return EFAULT;
} else {
auto now = kgettimeofday();
buf = { now.tv_sec, now.tv_sec };