Fixed bug in sg_open_scsi_siblings() introduced with revision 802
This commit is contained in:
parent
bf0f065be0
commit
1400550c71
@ -1 +1 @@
|
|||||||
#define Cdrskin_timestamP "2007.04.10.082229"
|
#define Cdrskin_timestamP "2007.04.10.083119"
|
||||||
|
@ -433,11 +433,15 @@ static int sg_open_scsi_siblings(char *path, int driveno,
|
|||||||
int i_host_no = -1, i_channel_no = -1, i_target_no = -1, i_lun_no = -1;
|
int i_host_no = -1, i_channel_no = -1, i_target_no = -1, i_lun_no = -1;
|
||||||
char msg[161], fname[81];
|
char msg[161], fname[81];
|
||||||
struct stat stbuf;
|
struct stat stbuf;
|
||||||
dev_t last_rdev = 0;
|
dev_t last_rdev = 0, path_rdev;
|
||||||
|
|
||||||
static char tldev[][81]= {"/dev/sr%d", "/dev/scd%d", "/dev/sg%d", ""};
|
static char tldev[][81]= {"/dev/sr%d", "/dev/scd%d", "/dev/sg%d", ""};
|
||||||
/* ts A70609: removed "/dev/st%d" */
|
/* ts A70609: removed "/dev/st%d" */
|
||||||
|
|
||||||
|
if(stat(path, &stbuf) == -1)
|
||||||
|
return 0;
|
||||||
|
path_rdev = stbuf.st_rdev;
|
||||||
|
|
||||||
sg_select_device_family();
|
sg_select_device_family();
|
||||||
if (linux_sg_device_family[0] == 0)
|
if (linux_sg_device_family[0] == 0)
|
||||||
return 1;
|
return 1;
|
||||||
@ -454,6 +458,8 @@ static int sg_open_scsi_siblings(char *path, int driveno,
|
|||||||
for (i = 0; i < 32; i++) {
|
for (i = 0; i < 32; i++) {
|
||||||
sprintf(fname, tldev[tld], i);
|
sprintf(fname, tldev[tld], i);
|
||||||
if(stat(fname, &stbuf) == -1)
|
if(stat(fname, &stbuf) == -1)
|
||||||
|
continue;
|
||||||
|
if (path_rdev == stbuf.st_rdev)
|
||||||
continue;
|
continue;
|
||||||
if (*sibling_count > 0 && last_rdev == stbuf.st_rdev)
|
if (*sibling_count > 0 && last_rdev == stbuf.st_rdev)
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
Reference in New Issue
Block a user