From 9e7e22dc74ff1bb99e0e8dff63128ef087623480 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Wed, 31 Jul 2024 10:15:46 -0400 Subject: [PATCH] LibCore: Use Error::from_syscall to report get/setrlimit errors --- Userland/Libraries/LibCore/System.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibCore/System.cpp b/Userland/Libraries/LibCore/System.cpp index 232c9d6eb34..8df13df172b 100644 --- a/Userland/Libraries/LibCore/System.cpp +++ b/Userland/Libraries/LibCore/System.cpp @@ -1853,7 +1853,7 @@ ErrorOr 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 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 {}; }