mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:07:34 +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
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…
Add table
Add a link
Reference in a new issue