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.
This commit is contained in:
Angel 2020-05-26 12:33:06 +02:00 committed by Andreas Kling
parent 8ff4ebb589
commit 6137475c39
Notes: sideshowbarker 2024-07-19 17:34:07 +09:00

View file

@ -1944,7 +1944,7 @@ int Process::sys$readlink(const Syscall::SC_readlink_params* user_params)
return -EINVAL; return -EINVAL;
auto contents = description->read_entire_file(); auto contents = description->read_entire_file();
if (!contents.is_error()) if (contents.is_error())
return contents.error(); return contents.error();
auto link_target = String::copy(contents.value()); auto link_target = String::copy(contents.value());