diff options
author | Douglas Gilbert <dgilbert@interlog.com> | 2014-10-19 00:18:28 +0000 |
---|---|---|
committer | Douglas Gilbert <dgilbert@interlog.com> | 2014-10-19 00:18:28 +0000 |
commit | 649a5fc19092ea6141f0dddfd940a44a845b0778 (patch) | |
tree | bad1aa45585115e12a7256c26dfc9b71cd6eee48 /src/sg_raw.c | |
parent | 8a7b512674238d2a7a5b2e321a5e1be5980d14e0 (diff) | |
download | sg3_utils-649a5fc19092ea6141f0dddfd940a44a845b0778.tar.gz |
sg_raw: do not output/print data-in if error; sg_inq: fix --cmddt output if not supported by device
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@616 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'src/sg_raw.c')
-rw-r--r-- | src/sg_raw.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/sg_raw.c b/src/sg_raw.c index 6b2d01bc..2580b080 100644 --- a/src/sg_raw.c +++ b/src/sg_raw.c @@ -27,7 +27,7 @@ #include "sg_lib.h" #include "sg_pt.h" -#define SG_RAW_VERSION "0.4.10 (2014-08-29)" +#define SG_RAW_VERSION "0.4.11 (2014-10-18)" #ifdef SG_LIB_WIN32 #ifndef HAVE_SYSCONF @@ -569,7 +569,11 @@ main(int argc, char *argv[]) if (op->do_datain) { int data_len = op->datain_len - get_scsi_pt_resid(ptvp); - if (data_len == 0) { + + if (ret && !(SG_LIB_CAT_RECOVERED == ret || + SG_LIB_CAT_NO_SENSE == ret)) + fprintf(stderr, "Error %d occurred, no data received\n", ret); + else if (data_len == 0) { fprintf(stderr, "No data received\n"); } else { if (op->datain_file == NULL && !op->datain_binary) { |