mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 23:57:34 +00:00
Kernel: Use TRY() in sys$pledge()
This commit is contained in:
parent
95e74d1776
commit
ea911bc125
1 changed files with 2 additions and 8 deletions
|
@ -19,18 +19,12 @@ KResultOr<FlatPtr> Process::sys$pledge(Userspace<const Syscall::SC_pledge_params
|
||||||
|
|
||||||
OwnPtr<KString> promises;
|
OwnPtr<KString> promises;
|
||||||
if (params.promises.characters) {
|
if (params.promises.characters) {
|
||||||
auto promises_or_error = try_copy_kstring_from_user(params.promises);
|
promises = TRY(try_copy_kstring_from_user(params.promises));
|
||||||
if (promises_or_error.is_error())
|
|
||||||
return promises_or_error.error();
|
|
||||||
promises = promises_or_error.release_value();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
OwnPtr<KString> execpromises;
|
OwnPtr<KString> execpromises;
|
||||||
if (params.execpromises.characters) {
|
if (params.execpromises.characters) {
|
||||||
auto execpromises_or_error = try_copy_kstring_from_user(params.execpromises);
|
execpromises = TRY(try_copy_kstring_from_user(params.execpromises));
|
||||||
if (execpromises_or_error.is_error())
|
|
||||||
return execpromises_or_error.error();
|
|
||||||
execpromises = execpromises_or_error.release_value();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
auto parse_pledge = [&](auto pledge_spec, u32& mask) {
|
auto parse_pledge = [&](auto pledge_spec, u32& mask) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue