summaryrefslogtreecommitdiffstats
path: root/toolbox
diff options
context:
space:
mode:
authorArun Raghavan <arun.raghavan@collabora.co.uk>2012-01-10 19:31:31 +0530
committerArun Raghavan <arun.raghavan@collabora.co.uk>2012-07-10 10:43:57 +0530
commit6caab4ce959478b96c40955236e13e80ef83145d (patch)
tree492b27ce87419dc9a61c51330de2d91be7eb83ed /toolbox
parent2177c79bddc66e295599d87007d4cbec549e1cac (diff)
downloadsystem_core-6caab4ce959478b96c40955236e13e80ef83145d.zip
system_core-6caab4ce959478b96c40955236e13e80ef83145d.tar.gz
system_core-6caab4ce959478b96c40955236e13e80ef83145d.tar.bz2
vmstat: Fix -n flag
The loop condition for the number of iterations basically caused the argument to -n to be ignored. This fixes the condition appropriately.
Diffstat (limited to 'toolbox')
-rw-r--r--toolbox/vmstat.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/toolbox/vmstat.c b/toolbox/vmstat.c
index 600f136..4086ed0 100644
--- a/toolbox/vmstat.c
+++ b/toolbox/vmstat.c
@@ -75,7 +75,7 @@ int vmstat_main(int argc, char *argv[]) {
int toggle, count;
int i;
- iterations = 0;
+ iterations = -1;
delay = 1;
header_interval = 20;
@@ -119,7 +119,7 @@ int vmstat_main(int argc, char *argv[]) {
if (!header_interval)
print_header();
read_state(&s[1 - toggle]);
- while ((iterations == 0) || (iterations-- > 0)) {
+ while ((iterations < 0) || (iterations-- > 0)) {
sleep(delay);
read_state(&s[toggle]);
if (header_interval) {