mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-04 05:20:30 +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: https://github.com/LadybirdBrowser/ladybird/commit/9e7e22dc74f 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;
|
||||
|
||||
if (::getrlimit(resource, &limits) != 0)
|
||||
return Error::from_errno(errno);
|
||||
return Error::from_syscall("getrlimit"sv, -errno);
|
||||
|
||||
return limits;
|
||||
}
|
||||
|
@ -1864,7 +1864,7 @@ ErrorOr<void> set_resource_limits(int resource, rlim_t limit)
|
|||
limits.rlim_cur = limit;
|
||||
|
||||
if (::setrlimit(resource, &limits) != 0)
|
||||
return Error::from_errno(errno);
|
||||
return Error::from_syscall("setrlimit"sv, -errno);
|
||||
|
||||
return {};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue