From: Jens Axboe Date: Wed, 25 Apr 2007 12:24:12 +0000 (+0200) Subject: More iolog fixes X-Git-Tag: fio-1.16.1~3 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=733ed597a79e118bc2480974a4dc4676f2edede1;ds=sidebyside 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 --- 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");