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.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user