diff options
Diffstat (limited to 'src/core/cgroup.c')
-rw-r--r-- | src/core/cgroup.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/core/cgroup.c b/src/core/cgroup.c index 981aca53cd..ec8a262314 100644 --- a/src/core/cgroup.c +++ b/src/core/cgroup.c @@ -360,9 +360,7 @@ static char *format_cgroup_memory_limit_comparison(char *buf, size_t l, Unit *u, } void cgroup_context_dump(Unit *u, FILE* f, const char *prefix) { - _cleanup_free_ char *disable_controllers_str = NULL; - _cleanup_free_ char *cpuset_cpus = NULL; - _cleanup_free_ char *cpuset_mems = NULL; + _cleanup_free_ char *disable_controllers_str = NULL, *cpuset_cpus = NULL, *cpuset_mems = NULL; CGroupIODeviceLimit *il; CGroupIODeviceWeight *iw; CGroupIODeviceLatency *l; @@ -437,8 +435,8 @@ void cgroup_context_dump(Unit *u, FILE* f, const char *prefix) { prefix, c->startup_cpu_shares, prefix, format_timespan(q, sizeof(q), c->cpu_quota_per_sec_usec, 1), prefix, format_timespan(v, sizeof(v), c->cpu_quota_period_usec, 1), - prefix, cpuset_cpus, - prefix, cpuset_mems, + prefix, strempty(cpuset_cpus), + prefix, strempty(cpuset_mems), prefix, c->io_weight, prefix, c->startup_io_weight, prefix, c->blockio_weight, @@ -974,8 +972,10 @@ static void cgroup_apply_unified_cpuset(Unit *u, const CPUSet *cpus, const char _cleanup_free_ char *buf = NULL; buf = cpu_set_to_range_string(cpus); - if (!buf) - return; + if (!buf) { + log_oom(); + return; + } (void) set_attribute_and_warn(u, "cpuset", name, buf); } |