Blame SOURCES/iproute2-3.10.0-lnstat-interval.patch
|
|
5ebd6f |
diff --git a/misc/lnstat.c b/misc/lnstat.c
|
|
|
5ebd6f |
index dca10ad..847e33f 100644
|
|
|
5ebd6f |
--- a/misc/lnstat.c
|
|
|
5ebd6f |
+++ b/misc/lnstat.c
|
|
|
5ebd6f |
@@ -226,7 +226,7 @@ int main(int argc, char **argv)
|
|
|
5ebd6f |
MODE_NORMAL,
|
|
|
5ebd6f |
} mode = MODE_NORMAL;
|
|
|
5ebd6f |
|
|
|
5ebd6f |
- unsigned long count = 1;
|
|
|
5ebd6f |
+ unsigned long count = 0;
|
|
|
5ebd6f |
static struct field_params fp;
|
|
|
5ebd6f |
int num_req_files = 0;
|
|
|
5ebd6f |
char *req_files[LNSTAT_MAX_FILES];
|
|
|
5ebd6f |
@@ -336,13 +336,14 @@ int main(int argc, char **argv)
|
|
|
5ebd6f |
if (interval < 1 )
|
|
|
5ebd6f |
interval=1;
|
|
|
5ebd6f |
|
|
|
5ebd6f |
- for (i = 0; i < count; i++) {
|
|
|
5ebd6f |
+ for (i = 0; !count || i < count; ) {
|
|
|
5ebd6f |
if ((hdr > 1 && (! (i % 20))) || (hdr == 1 && i == 0))
|
|
|
5ebd6f |
print_hdr(stdout, header);
|
|
|
5ebd6f |
lnstat_update(lnstat_files);
|
|
|
5ebd6f |
print_line(stdout, lnstat_files, &fp);
|
|
|
5ebd6f |
fflush(stdout);
|
|
|
5ebd6f |
sleep(interval);
|
|
|
5ebd6f |
+ if (count) ++i;
|
|
|
5ebd6f |
}
|
|
|
5ebd6f |
}
|
|
|
5ebd6f |
|