mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-17 07:50:04 +00:00
LibCore: Use Error::from_syscall to report get/setrlimit errors
This commit is contained in:
parent
3abd3ef5e2
commit
9e7e22dc74
Notes:
github-actions[bot]
2024-07-31 16:13:36 +00:00
Author: https://github.com/trflynn89
Commit: 9e7e22dc74
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/914
1 changed files with 2 additions and 2 deletions
|
@ -1853,7 +1853,7 @@ ErrorOr<rlimit> get_resource_limits(int resource)
|
||||||
rlimit limits;
|
rlimit limits;
|
||||||
|
|
||||||
if (::getrlimit(resource, &limits) != 0)
|
if (::getrlimit(resource, &limits) != 0)
|
||||||
return Error::from_errno(errno);
|
return Error::from_syscall("getrlimit"sv, -errno);
|
||||||
|
|
||||||
return limits;
|
return limits;
|
||||||
}
|
}
|
||||||
|
@ -1864,7 +1864,7 @@ ErrorOr<void> set_resource_limits(int resource, rlim_t limit)
|
||||||
limits.rlim_cur = limit;
|
limits.rlim_cur = limit;
|
||||||
|
|
||||||
if (::setrlimit(resource, &limits) != 0)
|
if (::setrlimit(resource, &limits) != 0)
|
||||||
return Error::from_errno(errno);
|
return Error::from_syscall("setrlimit"sv, -errno);
|
||||||
|
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue