chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
systemd-activate: pass environment variables through
[elogind.git]
/
src
/
cgtop
/
cgtop.c
diff --git
a/src/cgtop/cgtop.c
b/src/cgtop/cgtop.c
index 9eb2d2fdebd108080ba9caaf2ecabb1acfed7880..f80d51efed60cfe31e56e8ed3b752188c83b5466 100644
(file)
--- 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 "hashmap.h"
#include "cgroup-util.h"
#include "build.h"
+#include "fileio.h"
typedef struct Group {
char *path;
typedef struct Group {
char *path;
@@
-443,11
+444,11
@@
static int display(Hashmap *a) {
qsort(array, n, sizeof(Group*), group_compare);
qsort(array, n, sizeof(Group*), group_compare);
- rows =
fd_lines(STDOUT_FILENO
);
- if (rows <= 0)
- rows =
25
;
+ rows =
lines(
);
+ if (rows <=
1
0)
+ rows =
10
;
- path_columns = columns
_uncached
() - 42;
+ path_columns = columns() - 42;
if (path_columns < 10)
path_columns = 10;
if (path_columns < 10)
path_columns = 10;
@@
-653,6
+654,8
@@
int main(int argc, char *argv[]) {
goto finish;
}
goto finish;
}
+ signal(SIGWINCH, columns_lines_cache_reset);
+
while (!quit) {
Hashmap *c;
usec_t t;
while (!quit) {
Hashmap *c;
usec_t t;