]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/exec-invoke: log about name of CPU sched policy
authorMike Yuan <me@yhndnzj.com>
Sat, 20 Dec 2025 17:37:48 +0000 (18:37 +0100)
committerMike Yuan <me@yhndnzj.com>
Sat, 20 Dec 2025 20:40:56 +0000 (21:40 +0100)
Follow-up for 4dcbfbb1adaeefbf2ed9d78f61a56fbcd0251ead

Also, do not encode errno in log if we know the precise cause,
i.e. unsupported.

src/core/exec-invoke.c

index 25b7f8366dace6da9d2e3c4008b7538b2fb94113..cf47d996b29a67bee117ca9590f9b36ed31ccfa2 100644 (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));
                 }
         }