init: fix exit status with bogus arguments
authorZev Weiss <zev@bewilderbeest.net>
Thu, 12 Mar 2015 20:28:17 +0000 (15:28 -0500)
committerJens Axboe <axboe@fb.com>
Tue, 17 Mar 2015 21:48:36 +0000 (15:48 -0600)
Had been exiting "successfully" on invalid command-line arguments.

Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
Signed-off-by: Jens Axboe <axboe@fb.com>
init.c

diff --git a/init.c b/init.c
index 7aedf2b..95e26b8 100644 (file)
--- a/init.c
+++ b/init.c
@@ -2135,6 +2135,7 @@ int parse_cmd_line(int argc, char *argv[], int client_type)
                                                td = NULL;
                                        }
                                        do_exit++;
+                                       exit_val = 1;
                                        break;
                                }
                                fio_options_set_ioengine_opts(l_opts, td);
@@ -2153,6 +2154,7 @@ int parse_cmd_line(int argc, char *argv[], int client_type)
                                        td = NULL;
                                }
                                do_exit++;
+                               exit_val = 1;
                        }
 
                        if (!ret && !strcmp(opt, "ioengine")) {
@@ -2161,6 +2163,7 @@ int parse_cmd_line(int argc, char *argv[], int client_type)
                                        put_job(td);
                                        td = NULL;
                                        do_exit++;
+                                       exit_val = 1;
                                        break;
                                }
                                fio_options_set_ioengine_opts(l_opts, td);