LibCore: Use Error::from_syscall to report get/setrlimit errors

This commit is contained in:
Timothy Flynn 2024-07-31 10:15:46 -04:00 committed by Andrew Kaster
parent 3abd3ef5e2
commit 9e7e22dc74
Notes: github-actions[bot] 2024-07-31 16:13:36 +00:00

View file

@ -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 {};
}