From 75add28aa17678fbf5b10947027efe7ac75d113d Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Wed, 10 Apr 2013 18:30:19 -0400 Subject: systemctl: ellipsize job list only when necessary, highlight running I was debugging systemd waiting on a missing disk, and noticed that the job listing could use some polishing. Jobs that are actually running are highlighted, so it's easier to see what very actually waiting for. Also, the needed widths are precalculated, to use available columns more ecomically. --- src/shared/util.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/shared/util.h') diff --git a/src/shared/util.h b/src/shared/util.h index 38851237ab..a8e962ea50 100644 --- a/src/shared/util.h +++ b/src/shared/util.h @@ -647,4 +647,11 @@ static inline bool logind_running(void) { return access("/run/systemd/seats/", F_OK) >= 0; } +static inline unsigned decimal_str_max(unsigned x) { + unsigned ans = 1; + while (x /= 10) + ans ++; + return ans; +} + int unlink_noerrno(const char *path); -- cgit v1.2.3-54-g00ecf