From 6137475c39d36cbe5471996f65ebfd42f4764983 Mon Sep 17 00:00:00 2001 From: Angel Date: Tue, 26 May 2020 12:33:06 +0200 Subject: [PATCH] Kernel: fix assertion on readlink() syscall The is_error() check on the KResultOr returned when reading the link target had a stray ! operator which causes link resolution to crash the kernel with an assertion error. --- Kernel/Process.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp index 44530a6872d..fa3599dec54 100644 --- a/Kernel/Process.cpp +++ b/Kernel/Process.cpp @@ -1944,7 +1944,7 @@ int Process::sys$readlink(const Syscall::SC_readlink_params* user_params) return -EINVAL; auto contents = description->read_entire_file(); - if (!contents.is_error()) + if (contents.is_error()) return contents.error(); auto link_target = String::copy(contents.value());