mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
Kernel: Make ptrace return an error on error
Returning 'result.error().code()' erroneously creates an
ErrorOr<FlatPtr> of the positive errno code, which breaks our
error-returning convention.
This seems to be due to a forgotten minus-sign during the refactoring in
9e51e295cf
. This latent bug was never
discovered, because currently the error-handling paths are rarely
exercised.
This commit is contained in:
parent
49adebf0fc
commit
0e6e1092f0
Notes:
sideshowbarker
2024-07-17 23:07:38 +09:00
Author: https://github.com/BenWiederhake Commit: https://github.com/SerenityOS/serenity/commit/0e6e1092f0a Pull-request: https://github.com/SerenityOS/serenity/pull/11113 Reviewed-by: https://github.com/BertalanD Reviewed-by: https://github.com/IdanHo Reviewed-by: https://github.com/creator1creeper1
1 changed files with 1 additions and 2 deletions
|
@ -162,8 +162,7 @@ ErrorOr<FlatPtr> Process::sys$ptrace(Userspace<const Syscall::SC_ptrace_params*>
|
|||
REQUIRE_PROMISE(ptrace);
|
||||
auto params = TRY(copy_typed_from_user(user_params));
|
||||
|
||||
auto result = handle_ptrace(params, *this);
|
||||
return result.is_error() ? result.error().code() : result.value();
|
||||
return handle_ptrace(params, *this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue