From a51b3573f0e9a4a8b87f92623248f20163e6201d Mon Sep 17 00:00:00 2001 From: Douglas Gilbert Date: Wed, 15 Jan 2014 23:32:03 +0000 Subject: 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 --- src/sg_copy_results.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/sg_copy_results.c') 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: -- cgit v1.2.3