aboutsummaryrefslogtreecommitdiff
path: root/src/sg_luns.c
diff options
context:
space:
mode:
authorDouglas Gilbert <dgilbert@interlog.com>2021-06-23 18:09:48 +0000
committerDouglas Gilbert <dgilbert@interlog.com>2021-06-23 18:09:48 +0000
commit303f8c98ee28150285d69bd213970144fe224da3 (patch)
tree3cdbf0cc482229b65481fe30049c92fa3c2f1faa /src/sg_luns.c
parentbee57c535c29a01cadfaa660d8c0182288960c33 (diff)
downloadsg3_utils-303f8c98ee28150285d69bd213970144fe224da3.tar.gz
Haiku OS support, add pt function list in sg_pt_dummy.c; add slices to sg_mrq_dd
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@905 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'src/sg_luns.c')
-rw-r--r--src/sg_luns.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/sg_luns.c b/src/sg_luns.c
index c538956c..342b24f5 100644
--- a/src/sg_luns.c
+++ b/src/sg_luns.c
@@ -34,7 +34,7 @@
* and decodes the response.
*/
-static const char * version_str = "1.46 20210610"; /* spc6r05 */
+static const char * version_str = "1.47 20210616"; /* spc6r05 */
#define MAX_RLUNS_BUFF_LEN (1024 * 1024)
#define DEF_RLUNS_BUFF_LEN (1024 * 8)
@@ -599,7 +599,12 @@ main(int argc, char * argv[])
sg_fd = sg_cmds_open_device(device_name, o_readonly, verbose);
if (sg_fd < 0) {
- pr2serr("open error: %s: %s\n", device_name, safe_strerror(-sg_fd));
+ int err = -sg_fd;
+
+ pr2serr("open error: %s: %s\n", device_name, safe_strerror(err));
+ if ((! o_readonly) && ((err == EACCES) || (err == EROFS)))
+ pr2serr("Perhaps try again with --readonly option or with root "
+ "permissions\n");
return sg_convert_errno(-sg_fd);
}
if (decode_arg && (! lu_cong_arg_given)) {