mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 23:47:43 +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
70 changed files with 747 additions and 742 deletions
|
@ -31,7 +31,7 @@
|
|||
|
||||
namespace Kernel {
|
||||
|
||||
int Process::sys$chmod(Userspace<const char*> user_path, size_t path_length, mode_t mode)
|
||||
KResultOr<int> Process::sys$chmod(Userspace<const char*> user_path, size_t path_length, mode_t mode)
|
||||
{
|
||||
REQUIRE_PROMISE(fattr);
|
||||
auto path = get_syscall_path_argument(user_path, path_length);
|
||||
|
@ -40,12 +40,12 @@ int Process::sys$chmod(Userspace<const char*> user_path, size_t path_length, mod
|
|||
return VFS::the().chmod(path.value(), mode, current_directory());
|
||||
}
|
||||
|
||||
int Process::sys$fchmod(int fd, mode_t mode)
|
||||
KResultOr<int> Process::sys$fchmod(int fd, mode_t mode)
|
||||
{
|
||||
REQUIRE_PROMISE(fattr);
|
||||
auto description = file_description(fd);
|
||||
if (!description)
|
||||
return -EBADF;
|
||||
return EBADF;
|
||||
return description->chmod(mode);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue