Add support for options being a power-of-2
[fio.git] / eta.c
diff --git a/eta.c b/eta.c
index 5be5aed3bcc3a6bb397a06dc6314eb5652d66fbf..e458457a902f4df3fc3e6642c402abf6148c7016 100644 (file)
--- a/eta.c
+++ b/eta.c
@@ -6,6 +6,7 @@
 #include <string.h>
 
 #include "fio.h"
+#include "lib/pow2.h"
 
 static char __run_str[REAL_MAX_JOBS + 1];
 static char run_str[__THREAD_RUNSTR_SZ(REAL_MAX_JOBS)];
@@ -572,9 +573,11 @@ struct jobs_eta *get_jobs_eta(int force, size_t *size)
 
        *size = sizeof(*je) + THREAD_RUNSTR_SZ;
        je = malloc(*size);
+       if (!je)
+               return NULL;
        memset(je, 0, *size);
 
-       if (!calc_thread_status(je, 0)) {
+       if (!calc_thread_status(je, force)) {
                free(je);
                return NULL;
        }