From 733ed597a79e118bc2480974a4dc4676f2edede1 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Wed, 25 Apr 2007 14:24:12 +0200 Subject: [PATCH] More iolog fixes - Warn if nrfiles > 1, so that the user knows it's not supported - Need to clear ipo on malloc, or ->file could be some random value. Signed-off-by: Jens Axboe --- log.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/log.c b/log.c index de3b759c..9669b4a7 100644 --- a/log.c +++ b/log.c @@ -140,6 +140,7 @@ static int init_iolog_read(struct thread_data *td) } ipo = malloc(sizeof(*ipo)); + memset(ipo, 0, sizeof(*ipo)); INIT_LIST_HEAD(&ipo->list); ipo->offset = offset; ipo->len = bytes; @@ -171,6 +172,11 @@ static int init_iolog_write(struct thread_data *td) { FILE *f; + if (td->o.nr_files > 1) { + log_err("fio: write_iolog only works with 1 file currently\n"); + return 1; + } + f = fopen(td->o.write_iolog_file, "w+"); if (!f) { perror("fopen write iolog"); -- 2.25.1