init: use ErrnoErrorf() instead of ErrnoError() << StringPrintf()
Test: force init to print this line and see the log message
Change-Id: Ibb74572347f915cd76cc50f4c19126b66f562810
diff --git a/init/service_utils.cpp b/init/service_utils.cpp
index 93cffd8..eec5717 100644
--- a/init/service_utils.cpp
+++ b/init/service_utils.cpp
@@ -249,9 +249,8 @@
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);
}
}