From aeb32dfccbd052965b0e50714c12265551f61a00 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Mon, 8 Oct 2012 13:34:31 -0600 Subject: [PATCH] Fix confusion between terse and json output It'd segfault trying to use json when it wasn't supposed to, since we didn't have the parent set up appropriately. Signed-off-by: Jens Axboe --- diskutil.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/diskutil.c b/diskutil.c index d98e39a5..fbc4268e 100644 --- a/diskutil.c +++ b/diskutil.c @@ -658,7 +658,7 @@ void show_disk_util(int terse, struct json_object *parent) if (!terse) log_info("\nDisk stats (read/write):\n"); - if (terse && terse_version == 4) { + if (output_format == FIO_OUTPUT_JSON) { array = json_create_array(); json_object_add_value_array(parent, "disk_util", array); } @@ -667,7 +667,7 @@ void show_disk_util(int terse, struct json_object *parent) du = flist_entry(entry, struct disk_util, list); aggregate_slaves_stats(du); - if (terse && terse_version == 4) + if (output_format == FIO_OUTPUT_JSON) print_disk_util_json(du, array); else print_disk_util(&du->dus, &du->agg, terse); -- 2.25.1