load-fragment: make CPUSchedulingPolicy= accept the empty string

This commit is contained in:
Yu Watanabe
2018-05-31 11:09:41 +09:00
parent 617d253afa
commit b00e1a9e2a
+7
View 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);