core/exec-invoke: log about name of CPU sched policy

Follow-up for 4dcbfbb1ad

Also, do not encode errno in log if we know the precise cause,
i.e. unsupported.
This commit is contained in:
Mike Yuan
2025-12-20 21:40:56 +01:00
parent eb17c37df7
commit 72ce1046e8
+4 -1
View File
@@ -5478,7 +5478,10 @@ int exec_invoke(
return log_error_errno(errno, "Failed to set up CPU scheduling: %m");
}
log_warning_errno(errno, "CPU scheduling policy %u is not supported, ignoring: %m", attr.sched_policy);
_cleanup_free_ char *s = NULL;
(void) sched_policy_to_string_alloc(context->cpu_sched_policy, &s);
log_warning_errno(errno, "CPU scheduling policy %s is not supported, proceeding without.", strna(s));
}
}