client: fix ETA run_str
We never touched it before, which meant the client would just
display an empty string. Make a valiant effort to allocate and
output the run_str.
Signed-off-by: Jens Axboe <axboe@fb.com>
diff --git a/client.c b/client.c
index af6621d..828dd97 100644
--- a/client.c
+++ b/client.c
@@ -987,7 +987,12 @@
dst->eta_sec = je->eta_sec;
dst->nr_threads += je->nr_threads;
- /* we need to handle je->run_str too ... */
+
+ /*
+ * This wont be correct for multiple strings, but at least it
+ * works for the basic cases.
+ */
+ strcpy((char *) dst->run_str, (char *) je->run_str);
}
void fio_client_dec_jobs_eta(struct client_eta *eta, client_eta_op eta_fn)
@@ -1374,8 +1379,7 @@
dprint(FD_NET, "client: request eta (%d)\n", nr_clients);
- eta = malloc(sizeof(*eta));
- memset(&eta->eta, 0, sizeof(eta->eta));
+ eta = calloc(1, sizeof(*eta) + __THREAD_RUNSTR_SZ(REAL_MAX_JOBS));
eta->pending = nr_clients;
flist_for_each(entry, &client_list) {