mirror of
https://github.com/SerenityOS/serenity
synced 2024-09-30 05:05:10 +00:00
LibCore: Use Error::from_syscall to report get/setrlimit errors
(cherry picked from commit 9e7e22dc74ff1bb99e0e8dff63128ef087623480)
This commit is contained in:
parent
736c931a15
commit
5d70ea62db
|
@ -1891,7 +1891,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;
|
||||
}
|
||||
|
@ -1902,7 +1902,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