]> git.ipfire.org Git - ipfire-3.x.git/blobdiff - iproute2/patches/iproute2-3.12.0-lnstat-interval.patch
iproute2: Update to 3.14.0.
[ipfire-3.x.git] / iproute2 / patches / iproute2-3.12.0-lnstat-interval.patch
diff --git a/iproute2/patches/iproute2-3.12.0-lnstat-interval.patch b/iproute2/patches/iproute2-3.12.0-lnstat-interval.patch
new file mode 100644 (file)
index 0000000..b20f079
--- /dev/null
@@ -0,0 +1,34 @@
+diff --git a/misc/lnstat.c b/misc/lnstat.c
+index 8608cfa..8e8b1ba 100644
+--- a/misc/lnstat.c
++++ b/misc/lnstat.c
+@@ -253,7 +253,7 @@ int main(int argc, char **argv)
+               MODE_JSON,
+               MODE_NORMAL,
+       } mode = MODE_NORMAL;
+-      unsigned long count = 1;
++      unsigned long count = 0;
+       struct table_hdr *header;
+       static struct field_params fp;
+       int num_req_files = 0;
+@@ -366,7 +366,7 @@ int main(int argc, char **argv)
+               if (interval < 1 )
+                       interval = 1;
+-              for (i = 0; i < count; i++) {
++              for (i = 0; i < count || !count; ) {
+                       lnstat_update(lnstat_files);
+                       if (mode == MODE_JSON)
+                               print_json(stdout, lnstat_files, &fp);
+@@ -377,8 +377,10 @@ int main(int argc, char **argv)
+                               print_line(stdout, lnstat_files, &fp);
+                       }
+                       fflush(stdout);
+-                      if (i < count - 1)
++                      if (i < count - 1 || !count)
+                               sleep(interval);
++                      if (count)
++                              ++i;
+               }
+               break;
+       }