From e4f6424551258e4cc68d0a121cbcec57b216a48d Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 11 Dec 2023 16:27:54 +0100 Subject: [PATCH] spawn/ResourceLimits: use static_cast --- src/spawn/ResourceLimits.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/spawn/ResourceLimits.cxx b/src/spawn/ResourceLimits.cxx index 0c1cfdf4b..50662831c 100644 --- a/src/spawn/ResourceLimits.cxx +++ b/src/spawn/ResourceLimits.cxx @@ -25,14 +25,16 @@ using my_rlimit_resource_t = decltype(RLIMIT_NLIMITS); inline void ResourceLimit::Get(int pid, int resource) { - if (prlimit(pid, my_rlimit_resource_t(resource), nullptr, this) < 0) + if (prlimit(pid, static_cast(resource), + nullptr, this) < 0) throw FmtErrno("getrlimit({}) failed", resource); } inline void ResourceLimit::Set(int pid, int resource) const { - if (prlimit(pid, my_rlimit_resource_t(resource), this, nullptr) < 0) + if (prlimit(pid, static_cast(resource), + this, nullptr) < 0) throw FmtErrno("setrlimit({}, {}, {}) failed", resource, rlim_cur, rlim_max); }