aboutsummaryrefslogtreecommitdiff
path: root/src/sg_turs.c
diff options
context:
space:
mode:
authorDouglas Gilbert <dgilbert@interlog.com>2013-02-28 19:43:38 +0000
committerDouglas Gilbert <dgilbert@interlog.com>2013-02-28 19:43:38 +0000
commita8c0624e3b1afc56ed907b622e6e9f06d167760b (patch)
tree8b95d3c0b2e82128c6aa75567baf6bf1fdfc6346 /src/sg_turs.c
parent296bd3f7b07dbc0f648145303b82dba896499da6 (diff)
downloadsg3_utils-a8c0624e3b1afc56ed907b622e6e9f06d167760b.tar.gz
more UA exposure via noisy argument; doco
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@485 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'src/sg_turs.c')
-rw-r--r--src/sg_turs.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/src/sg_turs.c b/src/sg_turs.c
index f3611702..dc8d88b3 100644
--- a/src/sg_turs.c
+++ b/src/sg_turs.c
@@ -1,3 +1,16 @@
+/* This program sends a user specified number of TEST UNIT READY commands
+ to the given sg device. Since TUR is a simple command involing no
+ data transfer (and no REQUEST SENSE command iff the unit is ready)
+ then this can be used for timing per SCSI command overheads.
+
+ * Copyright (C) 2000-2013 D. Gilbert
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+
+ */
+
#include <unistd.h>
#include <fcntl.h>
#include <stdio.h>
@@ -16,20 +29,8 @@
#include "sg_lib.h"
#include "sg_cmds_basic.h"
-/* This program sends a user specified number of TEST UNIT READY commands
- to the given sg device. Since TUR is a simple command involing no
- data transfer (and no REQUEST SENSE command iff the unit is ready)
- then this can be used for timing per SCSI command overheads.
-
- * Copyright (C) 2000-2010 D. Gilbert
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
-
- */
-static char * version_str = "3.28 20101203";
+static char * version_str = "3.29 20130228";
#if defined(MSC_VER) || defined(__MINGW32__)
#define HAVE_MS_SLEEP
@@ -328,7 +329,8 @@ int main(int argc, char * argv[])
}
#endif
for (k = 0; k < opts.do_number; ++k) {
- res = sg_ll_test_unit_ready(sg_fd, k, 0, opts.do_verbose);
+ /* Might get Unit Attention on first invocation */
+ res = sg_ll_test_unit_ready(sg_fd, k, (0 == k), opts.do_verbose);
if (res) {
++num_errs;
ret = res;