X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcgtop%2Fcgtop.c;h=f80d51efed60cfe31e56e8ed3b752188c83b5466;hb=a4783bd17ad96f55b0fe83a50959da13555292bf;hp=ee421e383b2eec9e2314a006d79daee71033a32a;hpb=28917d7dc711746795f7e6468c06c1983a5cdf53;p=elogind.git diff --git a/src/cgtop/cgtop.c b/src/cgtop/cgtop.c index ee421e383..f80d51efe 100644 --- a/src/cgtop/cgtop.c +++ b/src/cgtop/cgtop.c @@ -31,6 +31,7 @@ #include "hashmap.h" #include "cgroup-util.h" #include "build.h" +#include "fileio.h" typedef struct Group { char *path; @@ -443,9 +444,9 @@ static int display(Hashmap *a) { qsort(array, n, sizeof(Group*), group_compare); - rows = fd_lines(STDOUT_FILENO); - if (rows <= 0) - rows = 25; + rows = lines(); + if (rows <= 10) + rows = 10; path_columns = columns() - 42; if (path_columns < 10) @@ -653,7 +654,7 @@ int main(int argc, char *argv[]) { goto finish; } - signal(SIGWINCH, columns_cache_reset); + signal(SIGWINCH, columns_lines_cache_reset); while (!quit) { Hashmap *c;