From 919290b79eb6649d6d05242180ddb3944ca9521b Mon Sep 17 00:00:00 2001 From: Douglas Gilbert Date: Thu, 24 May 2018 01:13:38 +0000 Subject: 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 --- src/sg_luns.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/sg_luns.c') 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 #include #include +#include #include #include #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)) -- cgit v1.2.3