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_luns.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_luns.c')
-rw-r--r-- | src/sg_luns.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/sg_luns.c b/src/sg_luns.c index d99b3481..e73d47e6 100644 --- a/src/sg_luns.c +++ b/src/sg_luns.c @@ -11,6 +11,7 @@ #include <stdlib.h> #include <stdbool.h> #include <string.h> +#include <errno.h> #include <ctype.h> #include <getopt.h> #define __STDC_FORMAT_MACROS 1 @@ -31,7 +32,7 @@ * and decodes the response. */ -static const char * version_str = "1.40 20180510"; +static const char * version_str = "1.41 20180522"; #define MAX_RLUNS_BUFF_LEN (1024 * 1024) #define DEF_RLUNS_BUFF_LEN (1024 * 8) @@ -598,7 +599,7 @@ main(int argc, char * argv[]) verbose > 3); if (NULL == reportLunsBuff) { pr2serr("unable to sg_memalign %d bytes\n", maxlen); - return SG_LIB_CAT_OTHER; + return sg_convert_errno(ENOMEM); } trunc = false; @@ -677,7 +678,7 @@ the_end: if (res < 0) { pr2serr("close error: %s\n", safe_strerror(-res)); if (0 == ret) - return SG_LIB_FILE_ERROR; + return sg_convert_errno(-res); } if (0 == verbose) { if (! sg_if_can2stderr("sg_luns failed: ", ret)) |