From b1d6dcf5a5c5aa02843c026dede0638f77798cb4 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Mon, 29 Sep 2014 07:31:14 -0500 Subject: Do not format USEC_INFINITY as NULL systemctl would print 'CPUQuotaPerSecUSec=(null)' for no limit. This does not look right. Since USEC_INFINITY is one of the valid values, format_timespan() could return NULL, and we should wrap every use of it in strna() or similar. But most callers didn't do that, and it seems more robust to return a string ("infinity") that makes sense most of the time, even if in some places the result will not be grammatically correct. --- src/core/cgroup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core/cgroup.c') diff --git a/src/core/cgroup.c b/src/core/cgroup.c index 6c6e4f5e7b..e604c3cbc6 100644 --- a/src/core/cgroup.c +++ b/src/core/cgroup.c @@ -111,7 +111,7 @@ void cgroup_context_dump(CGroupContext *c, FILE* f, const char *prefix) { prefix, yes_no(c->memory_accounting), prefix, c->cpu_shares, prefix, c->startup_cpu_shares, - prefix, strna(format_timespan(u, sizeof(u), c->cpu_quota_per_sec_usec, 1)), + prefix, format_timespan(u, sizeof(u), c->cpu_quota_per_sec_usec, 1), prefix, c->blockio_weight, prefix, c->startup_blockio_weight, prefix, c->memory_limit, -- cgit v1.2.3-54-g00ecf