diff options
author | Douglas Gilbert <dgilbert@interlog.com> | 2018-05-24 01:13:38 +0000 |
---|---|---|
committer | Douglas Gilbert <dgilbert@interlog.com> | 2018-05-24 01:13:38 +0000 |
commit | 919290b79eb6649d6d05242180ddb3944ca9521b (patch) | |
tree | e2b2f839acafdc5493bb21e81e4361f37c8f4357 /src/sg_get_lba_status.c | |
parent | 26e76bf6c671941fec1a8d2b3fb53fcd64993577 (diff) | |
download | sg3_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_get_lba_status.c')
-rw-r--r-- | src/sg_get_lba_status.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/sg_get_lba_status.c b/src/sg_get_lba_status.c index 0c48f886..09ad04c6 100644 --- a/src/sg_get_lba_status.c +++ b/src/sg_get_lba_status.c @@ -12,6 +12,7 @@ #include <stdarg.h> #include <stdbool.h> #include <string.h> +#include <errno.h> #include <getopt.h> #define __STDC_FORMAT_MACROS 1 #include <inttypes.h> @@ -276,7 +277,7 @@ main(int argc, char * argv[]) verbose > 3); if (NULL == glbasBuffp) { pr2serr("unable to allocate %d bytes on heap\n", maxlen); - return SG_LIB_SYNTAX_ERROR; + return sg_convert_errno(ENOMEM); } } if (do_raw) { @@ -358,7 +359,7 @@ main(int argc, char * argv[]) &add_status); if ((res < 0) || (res > 15)) { pr2serr("first LBA status descriptor returned %d ??\n", res); - ret = SG_LIB_CAT_OTHER; + ret = SG_LIB_LOGIC_ERROR; goto the_end; } if ((lba < d_lba) || (lba >= (d_lba + d_blocks))) { |