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.
This commit is contained in:
+1
-1
@@ -242,7 +242,7 @@ static void timer_dump(Unit *u, FILE *f, const char *prefix) {
|
||||
"%s%s: %s\n",
|
||||
prefix,
|
||||
timer_base_to_string(v->base),
|
||||
strna(format_timespan(timespan1, sizeof(timespan1), v->value, 0)));
|
||||
format_timespan(timespan1, sizeof(timespan1), v->value, 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user