From 291a2d8569b0fb51257a18faf17867d022660499 Mon Sep 17 00:00:00 2001 From: Erwan Velu Date: Wed, 9 Sep 2020 18:31:25 +0200 Subject: [PATCH] init: exiting with fio_show_ioengine_help return code In the current code, calling --enghelp= always return 0. But fio_show_ioengine_help() implemented a return code to inform when an engine is present or not. This commit makes fio returning fio_show_ioengine_help() value when calling --enghelp= A typical use case is detecting which engine is available on a given fio build. It is possible to use the return code to determine if a given engine is available or not : [user@host]# fio --enghelp=libaio userspace_reap : Use alternative user-space reap implementation [user@host]# echo $? 0 [user@host]#fio --enghelp=io_uring fio: engine io_uring not loadable IO engine io_uring not found [user@host]# echo $? 1 Signed-off-by: Erwan Velu --- init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.c b/init.c index 3cd0238b..7f64ce21 100644 --- a/init.c +++ b/init.c @@ -2543,7 +2543,7 @@ int parse_cmd_line(int argc, char *argv[], int client_type) case 'i': did_arg = true; if (!cur_client) { - fio_show_ioengine_help(optarg); + exit_val = fio_show_ioengine_help(optarg); do_exit++; } break; -- 2.25.1