From 784b9a1a327c23652c945785dab6f2979c0af06c Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 30 Nov 2017 16:29:48 +0900 Subject: [PATCH] run: Allows the user to reset CPUAffinity= back to an empty list Before this CPUAffinity= requires a valid cpu set, and the setting cannot be reset. Moreover, if CPUAffinity= with empty string is passed, then message container is closed without no values appended, thus we get error. This makes CPUAffinity= accepts empty string to reset the setting and avoid error. --- src/shared/bus-unit-util.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/shared/bus-unit-util.c b/src/shared/bus-unit-util.c index 6ed0085..643daa6 100644 --- a/src/shared/bus-unit-util.c +++ b/src/shared/bus-unit-util.c @@ -705,8 +705,7 @@ int bus_append_unit_property_assignment(sd_bus_message *m, const char *assignmen if (r < 0) return bus_log_create_error(r); - if (cpuset) - sd_bus_message_append_array(m, 'y', cpuset, CPU_ALLOC_SIZE(ncpus)); + sd_bus_message_append_array(m, 'y', cpuset, CPU_ALLOC_SIZE(ncpus)); r = sd_bus_message_close_container(m); -- 2.7.4