aboutsummaryrefslogtreecommitdiff
path: root/src/sg_copy_results.c
diff options
context:
space:
mode:
authorDouglas Gilbert <dgilbert@interlog.com>2014-01-15 23:32:03 +0000
committerDouglas Gilbert <dgilbert@interlog.com>2014-01-15 23:32:03 +0000
commita51b3573f0e9a4a8b87f92623248f20163e6201d (patch)
treec0543f36ba52cd0356d63d9b71696dfa16b4d236 /src/sg_copy_results.c
parentaa33a1ecaa4bf803f77ba4ae91a372adaf18b4d4 (diff)
downloadsg3_utils-a51b3573f0e9a4a8b87f92623248f20163e6201d.tar.gz
sg_readcap: for --16 show physical block size if different
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@544 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'src/sg_copy_results.c')
-rw-r--r--src/sg_copy_results.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/sg_copy_results.c b/src/sg_copy_results.c
index d73bf5d9..0ad2c799 100644
--- a/src/sg_copy_results.c
+++ b/src/sg_copy_results.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2013 Hannes Reinecke, SUSE Labs
+ * Copyright (c) 2011-2014 Hannes Reinecke, SUSE Labs
* All rights reserved.
* Use of this source code is governed by a BSD-style
* license that can be found in the BSD_LICENSE file.
@@ -34,7 +34,7 @@
and the optional list identifier passed as the list_id argument.
*/
-static const char * version_str = "1.5 20131007";
+static const char * version_str = "1.6 20140111";
#define MAX_XFER_LEN 10000
@@ -297,11 +297,11 @@ static const char * rec_copy_name_arr[] = {
int
main(int argc, char * argv[])
{
- int sg_fd, res, c;
+ int sg_fd, res, c, k;
unsigned char * cpResultBuff = NULL;
int xfer_len = 520;
int sa = 3;
- int list_id = 0;
+ uint32_t list_id = 0;
int do_hex = 0;
int verbose = 0;
const char * cp;
@@ -330,11 +330,12 @@ main(int argc, char * argv[])
usage();
return 0;
case 'l':
- list_id = sg_get_num(optarg);
- if (-1 == list_id) {
+ k = sg_get_num(optarg);
+ if (-1 == k) {
fprintf(stderr, "bad argument to '--list_id'\n");
return SG_LIB_SYNTAX_ERROR;
}
+ list_id = (uint32_t)k;
break;
case 'p':
sa = 3;
@@ -406,7 +407,7 @@ main(int argc, char * argv[])
cp = rec_copy_name_arr[sa];
if (verbose)
fprintf(stderr, ME "issue %s to device %s\n\t\txfer_len= %d (0x%x), "
- "list_id=%d\n", cp, device_name, xfer_len, xfer_len,
+ "list_id=%" PRIu32 "\n", cp, device_name, xfer_len, xfer_len,
list_id);
/* In SPC-4 opcode 0x84, service actions have command names: