Here's patch which prevents endless loop in main(), when there are no additional parameters specified. Now we have:

        if (count > 0) {
            if (--count == 0)
                break;
        }

but when count is 0, we never get to that break, so we end up looping...

 iostat.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

Thanks,
Marek
diff --git a/procps/iostat.c b/procps/iostat.c
index 573419e..1c55be5 100644
--- a/procps/iostat.c
+++ b/procps/iostat.c
@@ -590,10 +590,11 @@ int iostat_main(int argc, char **argv)
 			dev_report(itv);
 		}
 
-		if (count > 0) {
-			if (--count == 0)
-				break;
-		}
+		if (count > 0)
+			--count;
+
+		if (count == 0)
+			break;
 
 		/* Backup current stats */
 		global_uptime[LAST] = global_uptime[CURRENT];
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to