]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: actually set the CPU scheduling policy when deserializing it
authorFrantisek Sumsal <frantisek@sumsal.cz>
Fri, 27 Oct 2023 15:16:57 +0000 (17:16 +0200)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Fri, 27 Oct 2023 17:50:06 +0000 (19:50 +0200)
src/core/execute-serialize.c

index 63ed6a6afcfe09b1ee033a6ed2bbaa39d6417370..18033fe9c3007a142382e142d54e24cd042819e8 100644 (file)
@@ -2968,9 +2968,9 @@ static int exec_context_deserialize(ExecContext *c, FILE *f) {
                                 return r;
                         c->ioprio_set = true;
                 } else if ((val = startswith(l, "exec-context-cpu-scheduling-policy="))) {
-                        r = sched_policy_from_string(val);
-                        if (r < 0)
-                                return r;
+                        c->cpu_sched_policy = sched_policy_from_string(val);
+                        if (c->cpu_sched_policy < 0)
+                                return -EINVAL;
                         c->cpu_sched_set = true;
                 } else if ((val = startswith(l, "exec-context-cpu-scheduling-priority="))) {
                         r = safe_atoi(val, &c->cpu_sched_priority);