#include "lib.h"
-static int status = 0;
-
static void usage(FILE *fp)
{
fprintf(fp,
ev = &eventq.v[i];
switch (ev->ev) {
case EV_WRITE: start = ev->pos; f |= f_write; break;
- case EV_STOP:
- nsectors += ev->pos - start; f &= ~f_write; break;
+ case EV_STOP: nsectors += ev->pos - start; f &= ~f_write; break;
}
if (ev->pos >= limit) break;
if (f&f_fixup) start = ev->pos;
copy_progress.render = render_copy_progress;
progress_additem(&progress, ©_progress);
- if (nsectors != limit) {
+ if (nsectors == limit - start)
+ { ndone = start; nsectors = limit; }
+ else {
disc_progress.render = render_disc_progress;
progress_additem(&progress, &disc_progress);
}
if (f&f_stats) {
gettimeofday(&tv1, 0); t = tvdiff(&tv0, &tv1);
+ if (nsectors == limit - start) { ndone -= start; nsectors -= start; }
tot = scale_bytes((double)nsectors*SECTORSZ, &totunit);
rate = scale_bytes((double)nsectors*SECTORSZ/t, &rateunit);
moan("all done: %.1f %sB in %s -- %.1f %sB/s",
#undef f_stats
#undef f_write
- return (status);
+ return (0);
}