From 57b94284710ffdcaaed86a863c47bae4cb7b7b3e Mon Sep 17 00:00:00 2001 From: Tom Cherry Date: Tue, 4 Feb 2020 15:20:27 -0800 Subject: [PATCH] init: use ErrnoErrorf() instead of ErrnoError() << StringPrintf() Test: force init to print this line and see the log message Change-Id: Ibb74572347f915cd76cc50f4c19126b66f562810 --- init/service_utils.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/init/service_utils.cpp b/init/service_utils.cpp index 93cffd866..eec571785 100644 --- a/init/service_utils.cpp +++ b/init/service_utils.cpp @@ -249,9 +249,8 @@ Result SetProcessAttributes(const ProcessAttributes& attr) { for (const auto& rlimit : attr.rlimits) { if (setrlimit(rlimit.first, &rlimit.second) == -1) { - return ErrnoError() << StringPrintf( - "setrlimit(%d, {rlim_cur=%ld, rlim_max=%ld}) failed", rlimit.first, - rlimit.second.rlim_cur, rlimit.second.rlim_max); + return ErrnoErrorf("setrlimit({}, {{rlim_cur={}, rlim_max={}}}) failed", rlimit.first, + rlimit.second.rlim_cur, rlimit.second.rlim_max); } }