]> granicus.if.org Git - sysstat/commitdiff
Fix #163: 'iostat -y' json output includes an invalid token
authorSebastien GODARD <sysstat@users.noreply.github.com>
Sat, 26 Aug 2017 13:34:00 +0000 (15:34 +0200)
committerSebastien GODARD <sysstat@users.noreply.github.com>
Sat, 26 Aug 2017 13:34:00 +0000 (15:34 +0200)
Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
iostat.c

index 6ccaa56ec6599a224533f7e045c38812e8a61c50..47ec602a32e3ae940499d7195575e81f8fc17aaf 100644 (file)
--- a/iostat.c
+++ b/iostat.c
@@ -1676,17 +1676,17 @@ void rw_io_stat_loop(long int count, struct tm *rectime)
                        if (count > 0) {
                                count--;
                        }
+                       if (DISPLAY_JSON_OUTPUT(flags)) {
+                               if (count) {
+                               printf(",");
+                               }
+                               printf("\n");
+                       }
                }
                else {
                        skip = 0;
                }
 
-               if (DISPLAY_JSON_OUTPUT(flags)) {
-                       if (count) {
-                       printf(",");
-                       }
-                       printf("\n");
-               }
                if (count) {
                        curr ^= 1;
                        pause();