summaryrefslogtreecommitdiff
path: root/src/cgtop
diff options
context:
space:
mode:
authorCharles Duffy <chaduffy@cisco.com>2015-05-22 22:18:15 -0500
committerCharles Duffy <chaduffy@cisco.com>2015-06-09 19:39:16 -0500
commit780fe62ecab08850cefd136b95f38c15cb31c0ec (patch)
tree4444c841c892516298fbdc8f5fd6fd6f8b6670c3 /src/cgtop
parenta2c9f63136775b128bdb9fb3e1b57f5ad977d5cb (diff)
cgtop: allow user to force looping behavior even in non-TTY mode
Diffstat (limited to 'src/cgtop')
-rw-r--r--src/cgtop/cgtop.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cgtop/cgtop.c b/src/cgtop/cgtop.c
index 8c58cd2c04..d04d6f225c 100644
--- a/src/cgtop/cgtop.c
+++ b/src/cgtop/cgtop.c
@@ -60,7 +60,7 @@ typedef struct Group {
} Group;
static unsigned arg_depth = 3;
-static unsigned arg_iterations = 0;
+static unsigned arg_iterations = (unsigned)-1;
static bool arg_batch = false;
static bool arg_raw = false;
static usec_t arg_delay = 1*USEC_PER_SEC;
@@ -715,8 +715,8 @@ int main(int argc, char *argv[]) {
signal(SIGWINCH, columns_lines_cache_reset);
- if (!on_tty())
- arg_iterations = 1;
+ if (arg_iterations == (unsigned)-1)
+ arg_iterations = on_tty() ? 0 : 1;
while (!quit) {
Hashmap *c;