summaryrefslogtreecommitdiff
path: root/Kernel/Syscalls/watch_file.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/watch_file.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/watch_file.cpp')
-rw-r--r--Kernel/Syscalls/watch_file.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/Syscalls/watch_file.cpp b/Kernel/Syscalls/watch_file.cpp
index 2f6194bc7a..880cb67065 100644
--- a/Kernel/Syscalls/watch_file.cpp
+++ b/Kernel/Syscalls/watch_file.cpp
@@ -31,7 +31,7 @@
namespace Kernel {
-int Process::sys$watch_file(Userspace<const char*> user_path, size_t path_length)
+KResultOr<int> Process::sys$watch_file(Userspace<const char*> user_path, size_t path_length)
{
REQUIRE_PROMISE(rpath);
auto path = get_syscall_path_argument(user_path, path_length);
@@ -46,7 +46,7 @@ int Process::sys$watch_file(Userspace<const char*> user_path, size_t path_length
auto& inode = custody->inode();
if (!inode.fs().supports_watchers())
- return -ENOTSUP;
+ return ENOTSUP;
int fd = alloc_fd();
if (fd < 0)