From 6c424d93e52538ffad36dbf6f544b4ad9c441fb4 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Fri, 7 Feb 2020 06:54:29 -0800 Subject: [PATCH] client: Make skipping option appending in handle_job_opt() more selective Instead of not appending an option to the option list if JSON output is disabled, only skip appending an option to the JSON option list. See also commit b127b679769c ("client: fix segfault for !json output"). Signed-off-by: Bart Van Assche --- client.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client.c b/client.c index 134497cb..84fc1f53 100644 --- a/client.c +++ b/client.c @@ -1141,14 +1141,14 @@ static void handle_job_opt(struct fio_client *client, struct fio_net_cmd *cmd) { struct cmd_job_option *pdu = (struct cmd_job_option *) cmd->payload; - if (!job_opt_object) - return; - pdu->global = le16_to_cpu(pdu->global); pdu->truncated = le16_to_cpu(pdu->truncated); pdu->groupid = le32_to_cpu(pdu->groupid); if (pdu->global) { + if (!job_opt_object) + return; + json_object_add_value_string(job_opt_object, (const char *)pdu->name, (const char *)pdu->value); -- 2.25.1