From 2be3eec330360e6735fb4e7d70907e11eaa346f8 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Wed, 10 Jun 2009 09:05:13 +0200 Subject: [PATCH 1/1] File close fixes Signed-off-by: Jens Axboe --- filesetup.c | 6 ++++-- fio.c | 2 -- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/filesetup.c b/filesetup.c index 17bdd263..a0a4b80d 100644 --- a/filesetup.c +++ b/filesetup.c @@ -710,8 +710,10 @@ void close_files(struct thread_data *td) struct fio_file *f; unsigned int i; - for_each_file(td, f, i) - td_io_close_file(td, f); + for_each_file(td, f, i) { + if (fio_file_open(f)) + td_io_close_file(td, f); + } } void close_and_free_files(struct thread_data *td) diff --git a/fio.c b/fio.c index 61aabb30..632b0025 100644 --- a/fio.c +++ b/fio.c @@ -1374,8 +1374,6 @@ static void run_threads(void) for_each_file(td, f, i) { if (fio_file_open(f)) td_io_close_file(td, f); - else - assert(f->fd == -1); } } -- 2.25.1