]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
load-fragment: make CPUSchedulingPolicy= accept the empty string
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 25 May 2018 02:36:10 +0000 (11:36 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 31 May 2018 02:09:41 +0000 (11:09 +0900)
src/core/load-fragment.c

index 94583b5662a8dafd41678881276c07b5d9bc6ff4..4e1c721a79195fdb46c6e7fc69d6eae14fcc5936 100644 (file)
@@ -1189,6 +1189,13 @@ int config_parse_exec_cpu_sched_policy(const char *unit,
         assert(rvalue);
         assert(data);
 
+        if (isempty(rvalue)) {
+                c->cpu_sched_set = false;
+                c->cpu_sched_policy = SCHED_OTHER;
+                c->cpu_sched_priority = 0;
+                return 0;
+        }
+
         x = sched_policy_from_string(rvalue);
         if (x < 0) {
                 log_syntax(unit, LOG_ERR, filename, line, 0, "Failed to parse CPU scheduling policy, ignoring: %s", rvalue);