init: use ErrnoErrorf() instead of ErrnoError() << StringPrintf()

Test: force init to print this line and see the log message
Change-Id: Ibb74572347f915cd76cc50f4c19126b66f562810
This commit is contained in:
Tom Cherry 2020-02-04 15:20:27 -08:00
parent f8e6bf6d81
commit 57b9428471

View file

@ -249,9 +249,8 @@ Result<void> 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);
}
}