[PATCH]: iostat: prevent endless loop

Denys Vlasenko vda.linux at googlemail.com
Thu Aug 12 13:39:32 UTC 2010


On Thu, Aug 12, 2010 at 1:25 PM, Marek Polacek <mmpolacek at gmail.com> wrote:
>  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...

I can achieve the same by setting the default count to 1, not 0.

Here's the fix in git:

http://git.busybox.net/busybox/commit/?id=dcaed97

-- 
vda


More information about the busybox mailing list