cpu-set-util: Accept commas as separators in parse_cpu_set_and_warn

Tested CPUAffinity settings on both a service unit and in system.conf
and confirmed they work as expected.

Added a new test to confirm that trailing commas and spaces work and to
prevent any regressions in that area.
This commit is contained in:
Filipe Brandenburger
2015-10-27 17:39:58 -07:00
parent dc1e811ebd
commit 4fc66acb93
2 changed files with 16 additions and 3 deletions
+1 -1
View File
@@ -75,7 +75,7 @@ int parse_cpu_set_and_warn(
unsigned cpu;
int r;
r = extract_first_word(&rvalue, &word, WHITESPACE, EXTRACT_QUOTES);
r = extract_first_word(&rvalue, &word, WHITESPACE ",", EXTRACT_QUOTES);
if (r < 0) {
log_syntax(unit, LOG_ERR, filename, line, r, "Invalid value for %s: %s", lvalue, whole_rvalue);
return r;