[PATCH] Catch and print if directory= doesn't exist
[fio.git] / eta.c
diff --git a/eta.c b/eta.c
index feda8d0f15615e764c1ff0a590f5cfd858aa989f..fc485985ec6a833eaf57f26c83cac8d4689e1e15 100644 (file)
--- a/eta.c
+++ b/eta.c
@@ -70,7 +70,7 @@ static void check_str_update(struct thread_data *td)
 static void eta_to_str(char *str, int eta_sec)
 {
        unsigned int d, h, m, s;
-       static int always_d, always_h;
+       int disp_hour = 0;
 
        d = h = m = s = 0;
 
@@ -82,14 +82,13 @@ static void eta_to_str(char *str, int eta_sec)
        eta_sec /= 24;
        d = eta_sec;
 
-       if (d || always_d) {
-               always_d = 1;
+       if (d) {
+               disp_hour = 1;
                str += sprintf(str, "%02ud:", d);
        }
-       if (h || always_h) {
-               always_h = 1;
+
+       if (h || disp_hour)
                str += sprintf(str, "%02uh:", h);
-       }
 
        str += sprintf(str, "%02um:", m);
        str += sprintf(str, "%02us", s);
@@ -242,8 +241,10 @@ void print_thread_status(void)
                r_rate = (io_bytes[0] - prev_io_bytes[0]) / mtime;
                w_rate = (io_bytes[1] - prev_io_bytes[1]) / mtime;
                fio_gettime(&prev_time, NULL);
-               add_agg_sample(r_rate, DDIR_READ);
-               add_agg_sample(w_rate, DDIR_WRITE);
+               if (write_bw_log) {
+                       add_agg_sample(r_rate, DDIR_READ);
+                       add_agg_sample(w_rate, DDIR_WRITE);
+               }
                memcpy(prev_io_bytes, io_bytes, sizeof(io_bytes));
        }