Windows fixes
[fio.git] / eta.c
diff --git a/eta.c b/eta.c
index b7f1fd62cffe88e2bdac92c5d325ec8fbfb25a55..7e837badc6d1b35368f26f82708aab6fe5e207a5 100644 (file)
--- a/eta.c
+++ b/eta.c
@@ -18,7 +18,12 @@ static void check_str_update(struct thread_data *td)
 
        switch (td->runstate) {
        case TD_REAPED:
-               c = '_';
+               if (td->error)
+                       c = 'X';
+               else if (td->sig)
+                       c = 'K';
+               else
+                       c = '_';
                break;
        case TD_EXITED:
                c = 'E';
@@ -418,10 +423,14 @@ void display_thread_status(struct jobs_eta *je)
 void print_thread_status(void)
 {
        struct jobs_eta *je;
+       size_t size;
 
-       je = malloc(sizeof(*je) + thread_number * sizeof(char));
+       if (!thread_number)
+               return;
 
-       memset(je, 0, sizeof(*je) + thread_number * sizeof(char));
+       size = sizeof(*je) + thread_number * sizeof(char) + 1;
+       je = malloc(size);
+       memset(je, 0, size);
 
        if (calc_thread_status(je, 0))
                display_thread_status(je);