Ver Fonte

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.
Angel há 5 anos atrás
pai
commit
6137475c39
1 ficheiros alterados com 1 adições e 1 exclusões
  1. 1 1
      Kernel/Process.cpp

+ 1 - 1
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());