From 20e354ef1243541ea196619772b83a962d7cb4df Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Mon, 23 Jul 2007 14:36:16 +0200 Subject: [PATCH 1/1] Add ->done variable to force exit when we know we are done Signed-off-by: Jens Axboe --- fio.c | 2 ++ fio.h | 1 + log.c | 1 + 3 files changed, 4 insertions(+) diff --git a/fio.c b/fio.c index 16e19c8f..bc837c44 100644 --- a/fio.c +++ b/fio.c @@ -724,6 +724,8 @@ static int keep_running(struct thread_data *td) { unsigned long long io_done; + if (td->done) + return 0; if (td->o.time_based) return 1; if (td->o.loops) { diff --git a/fio.h b/fio.h index b7d8582e..ace4b164 100644 --- a/fio.h +++ b/fio.h @@ -472,6 +472,7 @@ struct thread_data { os_random_state_t next_file_state; }; int error; + int done; pid_t pid; char *orig_buffer; size_t orig_buffer_size; diff --git a/log.c b/log.c index cc90f437..7a3327e5 100644 --- a/log.c +++ b/log.c @@ -91,6 +91,7 @@ int read_iolog_get(struct thread_data *td, struct io_u *io_u) return 0; } + td->done = 1; return 1; } -- 2.25.1