From: Jens Axboe Date: Sat, 28 Jan 2006 19:36:09 +0000 (+0100) Subject: [PATCH] blktrace: really fix the loop logic X-Git-Tag: blktrace-0.99.1~98 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=27223f197c1694066a489b1153a9127b7ba377b1;p=blktrace.git [PATCH] blktrace: really fix the loop logic --- diff --git a/blktrace.c b/blktrace.c index aa7ac32..bb0a514 100644 --- a/blktrace.c +++ b/blktrace.c @@ -520,7 +520,7 @@ static void get_and_write_events(void) { struct device_information *dip; struct thread_information *tip; - int i, j, events, ret, all_exited; + int i, j, events, ret, tips_running; while (!is_done()) { events = 0; @@ -542,17 +542,17 @@ static void get_and_write_events(void) */ do { events = 0; - all_exited = 0; + tips_running = 0; for_each_dip(dip, i) { for_each_tip(dip, tip, j) { ret = write_tip_events(tip); if (ret > 0) events += ret; - all_exited += !tip->exited; + tips_running += !tip->exited; } } usleep(10); - } while (events || !all_exited); + } while (events || tips_running); } static int start_threads(struct device_information *dip)