X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=eta.c;h=5ea429404945bb63a6f63989b4df6bf50757af60;hb=1e97cce9f5a87a67293a05ec4533ed6968698b2e;hp=339f6568b16de68bb3e6af774dd875367f5f6292;hpb=c7b0818d2a9d1b8597256ea002d9cf9346ea97f3;p=fio.git diff --git a/eta.c b/eta.c index 339f6568..5ea42940 100644 --- a/eta.c +++ b/eta.c @@ -84,15 +84,15 @@ static void eta_to_str(char *str, int eta_sec) if (d || always_d) { always_d = 1; - str += sprintf(str, "%02dd:", d); + str += sprintf(str, "%02ud:", d); } if (h || always_h) { always_h = 1; - str += sprintf(str, "%02dh:", h); + str += sprintf(str, "%02uh:", h); } - str += sprintf(str, "%02dm:", m); - str += sprintf(str, "%02ds", s); + str += sprintf(str, "%02um:", m); + str += sprintf(str, "%02us", s); } /* @@ -101,7 +101,7 @@ static void eta_to_str(char *str, int eta_sec) static int thread_eta(struct thread_data *td, unsigned long elapsed) { unsigned long long bytes_total, bytes_done; - unsigned int eta_sec = 0; + unsigned long eta_sec = 0; bytes_total = td->total_io_size; @@ -127,7 +127,7 @@ static int thread_eta(struct thread_data *td, unsigned long elapsed) if (perc > 1.0) perc = 1.0; - eta_sec = (elapsed * (1.0 / perc)) - elapsed; + eta_sec = (unsigned long) (elapsed * (1.0 / perc)) - elapsed; if (td->timeout && eta_sec > (td->timeout - elapsed)) eta_sec = td->timeout - elapsed; @@ -238,7 +238,7 @@ void print_thread_status(void) if (mtime > 1000) { r_rate = (io_bytes[0] - prev_io_bytes[0]) / mtime; w_rate = (io_bytes[1] - prev_io_bytes[1]) / mtime; - gettimeofday(&prev_time, NULL); + fio_gettime(&prev_time, NULL); memcpy(prev_io_bytes, io_bytes, sizeof(io_bytes)); }