X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcgtop%2Fcgtop.c;h=f2e62761f14b6b7cef761975bd43491b7f4f62cc;hb=64abe9aa3f7dc7d755a4d3d1783fe3f0285edaea;hp=3756328fa7b7df80b93dd2cac249efb597c7712d;hpb=1421211924ff05af3b0c0d52f1c84472d0307456;p=elogind.git diff --git a/src/cgtop/cgtop.c b/src/cgtop/cgtop.c index 3756328fa..f2e62761f 100644 --- a/src/cgtop/cgtop.c +++ b/src/cgtop/cgtop.c @@ -300,7 +300,7 @@ static int refresh_one( r = cg_enumerate_subgroups(controller, path, &d); if (r < 0) { - if (r == ENOENT) + if (r == -ENOENT) return 0; return r; @@ -443,11 +443,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 +653,8 @@ int main(int argc, char *argv[]) { goto finish; } + signal(SIGWINCH, columns_lines_cache_reset); + while (!quit) { Hashmap *c; usec_t t;