X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcgtop%2Fcgtop.c;h=f80d51efed60cfe31e56e8ed3b752188c83b5466;hb=bf6dcfa6a79a459239799a21bdcba115d696a006;hp=9eb2d2fdebd108080ba9caaf2ecabb1acfed7880;hpb=2f29c419b01c104475f04d58a873b181273cfd8b;p=elogind.git diff --git a/src/cgtop/cgtop.c b/src/cgtop/cgtop.c index 9eb2d2fde..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,11 +444,11 @@ 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_uncached() - 42; + path_columns = columns() - 42; if (path_columns < 10) path_columns = 10; @@ -653,6 +654,8 @@ int main(int argc, char *argv[]) { goto finish; } + signal(SIGWINCH, columns_lines_cache_reset); + while (!quit) { Hashmap *c; usec_t t;