Bug fix: Device file comparison parameters were recorded wrong with Linux sg

This commit is contained in:
Thomas Schmitt 2018-09-02 22:02:02 +02:00
parent 2fe4b3ca2a
commit 3fdf11817d
2 changed files with 13 additions and 27 deletions

View File

@ -1 +1 @@
#define Cdrskin_timestamP "2018.08.26.141619"
#define Cdrskin_timestamP "2018.09.02.200129"

View File

@ -1041,22 +1041,18 @@ static int is_scsi_drive(char *fname, int fd_in, int *bus_no, int *host_no,
{ret = 0; goto ex;}
}
if (sid_ret == -1 || sid.scsi_id < 0) {
/* ts A61211 : employ a more general ioctl */
/* ts B11001 : re-use fd */
ret = sg_obtain_scsi_adr_fd(fname, fd, bus_no, host_no,
channel_no, target_no, lun_no);
if (ret>0) {
sid.host_no = *host_no;
sid.channel = *channel_no;
sid.scsi_id = *target_no;
sid.lun = *lun_no;
} else {
if (linux_sg_enumerate_debug)
fprintf(stderr,
"sg_obtain_scsi_adr_fd() failed\n");
{ret = 0; goto ex;}
}
/* ts A61211 : employ a more general ioctl */
/* ts B11001 : re-use fd */
/* ts B80902 : call unconditionally because host_no differs
between SG_GET_SCSI_ID and SCSI_IOCTL_GET_IDLUN
*/
ret = sg_obtain_scsi_adr_fd(fname, fd, bus_no, host_no,
channel_no, target_no, lun_no);
if (ret <= 0) {
if (linux_sg_enumerate_debug)
fprintf(stderr,
"sg_obtain_scsi_adr_fd() failed\n");
{ret = 0; goto ex;}
}
/* ts A60927 : trying to do locking with growisofs */
@ -1076,16 +1072,6 @@ static int is_scsi_drive(char *fname, int fd_in, int *bus_no, int *host_no,
sg_release_siblings(sibling_fds, sibling_fnames,
&sibling_count);
}
#ifdef SCSI_IOCTL_GET_BUS_NUMBER
if(*bus_no == -1)
*bus_no = 1000 * (sid.host_no + 1) + sid.channel;
#else
*bus_no = sid.host_no;
#endif
*host_no= sid.host_no;
*channel_no= sid.channel;
*target_no= sid.scsi_id;
*lun_no= sid.lun;
ret = 1;
ex:;
if (fd_in < 0 && fd >= 0) {