chiark / gitweb /
Do not format USEC_INFINITY as NULL
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 29 Sep 2014 12:31:14 +0000 (07:31 -0500)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 29 Sep 2014 15:09:39 +0000 (11:09 -0400)
commitb1d6dcf5a5c5aa02843c026dede0638f77798cb4
tree6065b8eedce06acb651c6ad2d378749049951fcb
parentee26bcc0387f6eda83878eb85a08c01ee0d82c44
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
src/core/timer.c
src/network/networkd-link.c
src/shared/time-util.c
src/test/test-time.c