summaryrefslogtreecommitdiff
path: root/Kernel/Syscalls/mknod.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-03-01 13:49:16 +0100
committerAndreas Kling <kling@serenityos.org>2021-03-01 13:54:32 +0100
commitac71775de5a71945e004f46b184dde4f628d112b (patch)
treebac755ef16ba74bd63d3a359e6aad9e32d2734ae /Kernel/Syscalls/mknod.cpp
parent9af1e1a3bf43140dee327eb4f553c56ba95ad9d9 (diff)
downloadserenity-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/mknod.cpp')
-rw-r--r--Kernel/Syscalls/mknod.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/Kernel/Syscalls/mknod.cpp b/Kernel/Syscalls/mknod.cpp
index 1b6a4d9444..393fab4c80 100644
--- a/Kernel/Syscalls/mknod.cpp
+++ b/Kernel/Syscalls/mknod.cpp
@@ -30,14 +30,14 @@
namespace Kernel {
-int Process::sys$mknod(Userspace<const Syscall::SC_mknod_params*> user_params)
+KResultOr<int> Process::sys$mknod(Userspace<const Syscall::SC_mknod_params*> user_params)
{
REQUIRE_PROMISE(dpath);
Syscall::SC_mknod_params params;
if (!copy_from_user(&params, user_params))
- return -EFAULT;
+ return EFAULT;
if (!is_superuser() && !is_regular_file(params.mode) && !is_fifo(params.mode) && !is_socket(params.mode))
- return -EPERM;
+ return EPERM;
auto path = get_syscall_path_argument(params.path);
if (path.is_error())
return path.error();