Make sure now has a value before assigning it to last_print in

ScanProgressMeter::printStats. I messed this up in r11985. Brandon reported the
problem.
This commit is contained in:
david 2009-02-06 04:49:45 +00:00
parent 1491180c50
commit fda214ed63

View file

@ -560,6 +560,11 @@ bool ScanProgressMeter::printStats(double perc_done,
time_t timet;
struct tm *ltime;
if (!now) {
gettimeofday(&tvtmp, NULL);
now = (const struct timeval *) &tvtmp;
}
last_print = *now;
// If we're less than 1% done we probably don't have enough
@ -572,11 +577,6 @@ bool ScanProgressMeter::printStats(double perc_done,
return true;
}
if (!now) {
gettimeofday(&tvtmp, NULL);
now = (const struct timeval *) &tvtmp;
}
/* OK, now lets estimate the time to finish */
time_used_s = difftime(now->tv_sec, begin.tv_sec);
time_needed_s = time_used_s / perc_done;