From 30363466e3580cae5f428c9bf35caa934cef469b Mon Sep 17 00:00:00 2001 From: Douglas Gilbert Date: Mon, 7 Jun 2021 15:21:01 +0000 Subject: sg_vpd: fix do_hex type on some recent pages; sg_dd: don't close negative file descriptors; pt_linux_nvme: fix fua setting git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@903 6180dd3e-e324-4e3e-922d-17de1ae2f315 --- src/sg_raw.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/sg_raw.c') diff --git a/src/sg_raw.c b/src/sg_raw.c index c831a172..9cfa19c3 100644 --- a/src/sg_raw.c +++ b/src/sg_raw.c @@ -39,7 +39,7 @@ #include "sg_pr2serr.h" #include "sg_unaligned.h" -#define SG_RAW_VERSION "0.4.36 (2021-04-29)" +#define SG_RAW_VERSION "0.4.37 (2021-06-01)" #define DEFAULT_TIMEOUT 20 #define MIN_SCSI_CDBSZ 6 @@ -300,13 +300,6 @@ parse_cmd_line(struct opts_t * op, int argc, char *argv[]) } } - if (optind >= argc) { - pr2serr("No device specified\n"); - return SG_LIB_SYNTAX_ERROR; - } - op->device_name = argv[optind]; - ++optind; - if (op->version_given #ifdef DEBUG && ! op->verbose_given @@ -314,6 +307,13 @@ parse_cmd_line(struct opts_t * op, int argc, char *argv[]) ) return 0; + if (optind >= argc) { + pr2serr("No device specified\n"); + return SG_LIB_SYNTAX_ERROR; + } + op->device_name = argv[optind]; + ++optind; + while (optind < argc) { char *opt = argv[optind++]; char *endptr; -- cgit v1.2.3