mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-17 07:50:04 +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:
parent
9af1e1a3bf
commit
ac71775de5
Notes:
sideshowbarker
2024-07-18 21:49:02 +09:00
Author: https://github.com/awesomekling
Commit: ac71775de5
70 changed files with 747 additions and 742 deletions
|
@ -29,21 +29,21 @@
|
|||
|
||||
namespace Kernel {
|
||||
|
||||
int Process::sys$fchown(int fd, uid_t uid, gid_t gid)
|
||||
KResultOr<int> Process::sys$fchown(int fd, uid_t uid, gid_t gid)
|
||||
{
|
||||
REQUIRE_PROMISE(chown);
|
||||
auto description = file_description(fd);
|
||||
if (!description)
|
||||
return -EBADF;
|
||||
return EBADF;
|
||||
return description->chown(uid, gid);
|
||||
}
|
||||
|
||||
int Process::sys$chown(Userspace<const Syscall::SC_chown_params*> user_params)
|
||||
KResultOr<int> Process::sys$chown(Userspace<const Syscall::SC_chown_params*> user_params)
|
||||
{
|
||||
REQUIRE_PROMISE(chown);
|
||||
Syscall::SC_chown_params params;
|
||||
if (!copy_from_user(¶ms, user_params))
|
||||
return -EFAULT;
|
||||
return EFAULT;
|
||||
auto path = get_syscall_path_argument(params.path);
|
||||
if (path.is_error())
|
||||
return path.error();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue