diff options
Diffstat (limited to 'src/sg_luns.c')
-rw-r--r-- | src/sg_luns.c | 9 |
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)) { |