aboutsummaryrefslogtreecommitdiff
path: root/lib/sg_cmds_basic.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 /lib/sg_cmds_basic.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 'lib/sg_cmds_basic.c')
-rw-r--r--lib/sg_cmds_basic.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/sg_cmds_basic.c b/lib/sg_cmds_basic.c
index 53014180..81c24a1a 100644
--- a/lib/sg_cmds_basic.c
+++ b/lib/sg_cmds_basic.c
@@ -37,7 +37,7 @@
#endif
-static const char * const version_str = "1.86 20180501";
+static const char * const version_str = "1.87 20180522";
#define SENSE_BUFF_LEN 64 /* Arbitrary, could be larger */
@@ -90,12 +90,6 @@ pr2ws(const char * fmt, ...)
int
sg_cmds_open_device(const char * device_name, bool read_only, int verbose)
{
- /* The following 2 lines are temporary. It is to avoid a NULL pointer
- * crash when an old utility is used with a newer library built after
- * the sg_warnings_strm cleanup */
- if (NULL == sg_warnings_strm)
- sg_warnings_strm = stderr;
-
return scsi_pt_open_device(device_name, read_only, verbose);
}
@@ -692,7 +686,7 @@ sg_ll_report_luns(int sg_fd, int select_report, void * resp, int mx_resp_len,
}
if (NULL == ((ptvp = create_pt_obj(report_luns_s))))
- return -1;
+ return sg_convert_errno(ENOMEM);
set_scsi_pt_cdb(ptvp, rl_cdb, sizeof(rl_cdb));
set_scsi_pt_sense(ptvp, sense_b, sizeof(sense_b));
set_scsi_pt_data_in(ptvp, (uint8_t *)resp, mx_resp_len);