summaryrefslogtreecommitdiff
path: root/src/shared/cgroup-show.c
diff options
context:
space:
mode:
authorMichal Schmidt <mschmidt@redhat.com>2012-11-12 22:27:48 +0100
committerMichal Schmidt <mschmidt@redhat.com>2012-11-12 22:27:48 +0100
commit45a5ff0de744bc73a0695e61f749ee983ef97b64 (patch)
tree43a5c000f1aaf347bd9304d3e6ba3b06b2934103 /src/shared/cgroup-show.c
parenta9cdc94f7ff40f22a3cf9472f612a80730a1b010 (diff)
util: nicer tree drawings
Draw trees more similar to pstree/findmnt/lsblk/...
Diffstat (limited to 'src/shared/cgroup-show.c')
-rw-r--r--src/shared/cgroup-show.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/shared/cgroup-show.c b/src/shared/cgroup-show.c
index 69fe7fc96d..437d09711b 100644
--- a/src/shared/cgroup-show.c
+++ b/src/shared/cgroup-show.c
@@ -86,10 +86,10 @@ static void show_pid_array(int pids[], unsigned n_pids, const char *prefix, unsi
get_process_cmdline(pids[i], n_columns, true, &t);
- printf("%s%s %*lu %s\n",
+ printf("%s%s%*lu %s\n",
prefix,
draw_special_char(extra ? DRAW_TRIANGULAR_BULLET :
- ((more || i < n_pids-1) ? DRAW_BOX_VERT_AND_RIGHT : DRAW_BOX_UP_AND_RIGHT)),
+ ((more || i < n_pids-1) ? DRAW_TREE_BRANCH : DRAW_TREE_RIGHT)),
pid_width,
(unsigned long) pids[i],
strna(t));
@@ -208,11 +208,11 @@ int show_cgroup_by_path(const char *path, const char *prefix, unsigned n_columns
}
if (last) {
- printf("%s%s %s\n", prefix, draw_special_char(DRAW_BOX_VERT_AND_RIGHT),
- path_get_file_name(last));
+ printf("%s%s%s\n", prefix, draw_special_char(DRAW_TREE_BRANCH),
+ path_get_file_name(last));
if (!p1) {
- p1 = strjoin(prefix, draw_special_char(DRAW_BOX_VERT), " ", NULL);
+ p1 = strappend(prefix, draw_special_char(DRAW_TREE_VERT));
if (!p1) {
free(k);
r = -ENOMEM;
@@ -234,8 +234,8 @@ int show_cgroup_by_path(const char *path, const char *prefix, unsigned n_columns
show_cgroup_one_by_path(path, prefix, n_columns, !!last, kernel_threads);
if (last) {
- printf("%s%s %s\n", prefix, draw_special_char(DRAW_BOX_UP_AND_RIGHT),
- path_get_file_name(last));
+ printf("%s%s%s\n", prefix, draw_special_char(DRAW_TREE_RIGHT),
+ path_get_file_name(last));
if (!p2) {
p2 = strappend(prefix, " ");