From afe22d3dbec867f8540ece355266b0427c69d51a Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Fri, 27 Jun 2014 15:30:06 -0600 Subject: [PATCH] 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 --- client.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/client.c b/client.c index af6621dc..828dd97b 100644 --- a/client.c +++ b/client.c @@ -987,7 +987,12 @@ void fio_client_sum_jobs_eta(struct jobs_eta *dst, struct jobs_eta *je) 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 @@ static void request_client_etas(struct client_ops *ops) 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) { -- 2.25.1