From 437c9b71527b14a8e872c03cd821179eba351474 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Tue, 13 Feb 2007 18:20:37 +0100 Subject: [PATCH] [PATCH] Make the exit value meaningfull Signed-off-by: Jens Axboe --- fio.c | 6 +++++- fio.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/fio.c b/fio.c index ace8c5ee..61fd0989 100644 --- a/fio.c +++ b/fio.c @@ -47,6 +47,7 @@ int temp_stall_ts; static volatile int startup_sem; static volatile int fio_abort; +static int exit_value; struct io_log *agg_io_log[2]; @@ -811,6 +812,9 @@ static void reap_threads(int *nr_running, int *t_rate, int *m_rate) continue; } + if (td->error) + exit_value++; + td_set_runstate(td, TD_REAPED); if (td->use_thread) { @@ -1045,5 +1049,5 @@ int main(int argc, char *argv[]) } } - return 0; + return exit_value; } diff --git a/fio.h b/fio.h index c0b92a6c..c15232a2 100644 --- a/fio.h +++ b/fio.h @@ -674,6 +674,7 @@ extern void close_ioengine(struct thread_data *); if (!(cond)) { \ fprintf(stderr, "file:%s:%d, assert %s failed\n", __FILE__, __LINE__, #cond); \ (td)->runstate = TD_EXITED; \ + (td)->error = EFAULT; \ exit(0); \ } \ } while (0) -- 2.25.1