Trying to avoid unnecessary access to sibling device objects

This commit is contained in:
Thomas Schmitt 2008-09-09 13:20:08 +00:00
parent bc30c4201a
commit c640c7954b
2 changed files with 17 additions and 17 deletions

View File

@ -1 +1 @@
#define Cdrskin_timestamP "2008.08.30.104339"
#define Cdrskin_timestamP "2008.09.09.131915"

View File

@ -729,7 +729,6 @@ static int is_scsi_drive(char *fname, int *bus_no, int *host_no,
}
#ifdef CDROM_DRIVE_STATUS
if (strcmp(linux_sg_device_family,"/dev/sg%d") != 0) {
/* http://developer.osdl.org/dev/robustmutexes/
src/fusyn.hg/Documentation/ioctl/cdrom.txt */
sid_ret = ioctl(fd, CDROM_DRIVE_STATUS, 0);
@ -741,7 +740,6 @@ static int is_scsi_drive(char *fname, int *bus_no, int *host_no,
sid.scsi_type = TYPE_ROM;
else
sid_ret = -1;
}
#endif /* CDROM_DRIVE_STATUS */
}
@ -1130,7 +1128,8 @@ static int fname_drive_is_listed(char *fname, int flag)
/* ts A80731 : Directly open the given address.
@param flag bit0= do not compain about missing file
@param flag bit0= do not complain about missing file
bit1= do not check whether drive is already listed
*/
static int fname_enumerate(char *fname, int flag)
{
@ -1139,6 +1138,7 @@ static int fname_enumerate(char *fname, int flag)
char msg[BURN_DRIVE_ADR_LEN + 80];
struct stat stbuf;
if (!(flag & 2))
if (fname_drive_is_listed(fname, 0))
return 2;
if (stat(fname, &stbuf) == -1) {
@ -1183,7 +1183,7 @@ static int single_enumerate(int flag)
fname= burn_drive_whitelist_item(0, 0);
if (fname == NULL)
return 0;
ret = fname_enumerate(fname, 0);
ret = fname_enumerate(fname, 2);
if (ret <= 0) {
sprintf(msg, "Cannot access '%s' as SG_IO CDROM drive", fname);
libdax_msgs_submit(libdax_messenger, -1, 0x0002000a,