diff options
author | Andreas Kling <kling@serenityos.org> | 2021-03-01 13:49:16 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-03-01 13:54:32 +0100 |
commit | ac71775de5a71945e004f46b184dde4f628d112b (patch) | |
tree | bac755ef16ba74bd63d3a359e6aad9e32d2734ae /Kernel/Syscalls/shutdown.cpp | |
parent | 9af1e1a3bf43140dee327eb4f553c56ba95ad9d9 (diff) | |
download | serenity-ac71775de5a71945e004f46b184dde4f628d112b.zip |
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.
Diffstat (limited to 'Kernel/Syscalls/shutdown.cpp')
-rw-r--r-- | Kernel/Syscalls/shutdown.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Kernel/Syscalls/shutdown.cpp b/Kernel/Syscalls/shutdown.cpp index 52d43c180e..16eb12e5a8 100644 --- a/Kernel/Syscalls/shutdown.cpp +++ b/Kernel/Syscalls/shutdown.cpp @@ -31,10 +31,10 @@ namespace Kernel { -int Process::sys$reboot() +KResultOr<int> Process::sys$reboot() { if (!is_superuser()) - return -EPERM; + return EPERM; REQUIRE_NO_PROMISES; @@ -51,10 +51,10 @@ int Process::sys$reboot() return 0; } -int Process::sys$halt() +KResultOr<int> Process::sys$halt() { if (!is_superuser()) - return -EPERM; + return EPERM; REQUIRE_NO_PROMISES; |