aboutsummaryrefslogtreecommitdiff
path: root/src/sg_unmap.c
diff options
context:
space:
mode:
authorDouglas Gilbert <dgilbert@interlog.com>2018-05-24 01:13:38 +0000
committerDouglas Gilbert <dgilbert@interlog.com>2018-05-24 01:13:38 +0000
commit919290b79eb6649d6d05242180ddb3944ca9521b (patch)
treee2b2f839acafdc5493bb21e81e4361f37c8f4357 /src/sg_unmap.c
parent26e76bf6c671941fec1a8d2b3fb53fcd64993577 (diff)
downloadsg3_utils-919290b79eb6649d6d05242180ddb3944ca9521b.tar.gz
add SG_LIB_LOGIC_ERROR and SG_LIB_CONTRADICT; implement across many utilities and increase usage of sg_convert_errno()
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@774 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'src/sg_unmap.c')
-rw-r--r--src/sg_unmap.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/sg_unmap.c b/src/sg_unmap.c
index 32295e0a..8451c468 100644
--- a/src/sg_unmap.c
+++ b/src/sg_unmap.c
@@ -44,7 +44,7 @@
* logical blocks. Note that DATA MAY BE LOST.
*/
-static const char * version_str = "1.15 20180514";
+static const char * version_str = "1.16 20180523";
#define DEF_TIMEOUT_SECS 60
@@ -501,14 +501,14 @@ main(int argc, char * argv[])
pr2serr("Can't have --all= together with --lba=, --num= or "
"--in=\n\n");
usage();
- return SG_LIB_SYNTAX_ERROR;
+ return SG_LIB_CONTRADICT;
}
/* here if --all= looks okay so far */
} else if (in_op && (lba_op || num_op)) {
pr2serr("expect '--in=' by itself, or both '--lba=' and "
"'--num='\n\n");
usage();
- return SG_LIB_SYNTAX_ERROR;
+ return SG_LIB_CONTRADICT;
} else if (in_op || (lba_op && num_op))
;
else {
@@ -518,14 +518,14 @@ main(int argc, char * argv[])
pr2serr("expect either both '--lba=' and '--num=', or "
"'--in=', or '--all='\n\n");
usage();
- return SG_LIB_SYNTAX_ERROR;
+ return SG_LIB_CONTRADICT;
}
if (all_rn > 0) {
if ((all_last > 0) && (all_start > all_last)) {
pr2serr("in --all=ST,RN,LA start address (ST) exceeds last "
"address (LA)\n");
- return SG_LIB_SYNTAX_ERROR;
+ return SG_LIB_CONTRADICT;
}
} else {
memset(addr_arr, 0, sizeof(addr_arr));
@@ -545,7 +545,7 @@ main(int argc, char * argv[])
if ((addr_arr_len != num_arr_len) || (num_arr_len <= 0)) {
pr2serr("need same number of arguments to '--lba=' "
"and '--num=' options\n");
- return SG_LIB_SYNTAX_ERROR;
+ return SG_LIB_CONTRADICT;
}
}
if (in_op) {
@@ -639,7 +639,7 @@ main(int argc, char * argv[])
pr2serr("after READ CAPACITY the last block (0x%" PRIx64
") less than start address (0x%" PRIx64 ")\n",
all_start, all_last);
- ret = SG_LIB_SYNTAX_ERROR;
+ ret = SG_LIB_CONTRADICT;
goto err_out;
}
to_end_of_device = true;