diff options
author | Tom Gundersen <teg@jklm.no> | 2015-09-01 19:48:04 +0200 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2015-09-01 19:48:04 +0200 |
commit | fc94c3260549c12892461be031c4b9dc122ca1ef (patch) | |
tree | 3b9bf7eccf1690daa57da5419d29554175605c20 /src/cgtop/cgtop.c | |
parent | 332929623af07716530fb0d0a30e792b564ea486 (diff) | |
parent | d06673212e7672da44d5147d1d393278d9b1b478 (diff) |
Merge pull request #1111 from poettering/more-cgroup-fixes
More cgroup fixes
Diffstat (limited to 'src/cgtop/cgtop.c')
-rw-r--r-- | src/cgtop/cgtop.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/cgtop/cgtop.c b/src/cgtop/cgtop.c index 06a43d15e4..ae562ba135 100644 --- a/src/cgtop/cgtop.c +++ b/src/cgtop/cgtop.c @@ -560,15 +560,17 @@ static void display(Hashmap *a) { path_columns = maxtpath; for (j = 0; j < n; j++) { - _cleanup_free_ char *p = NULL; + _cleanup_free_ char *ellipsized = NULL; + const char *path; if (on_tty() && j + 5 > rows) break; g = array[j]; - p = ellipsize(g->path, path_columns, 33); - printf("%-*s", path_columns, p ?: g->path); + path = isempty(g->path) ? "/" : g->path; + ellipsized = ellipsize(path, path_columns, 33); + printf("%-*s", path_columns, ellipsized ?: path); if (g->n_tasks_valid) printf(" %7u", g->n_tasks); |