Trying to avoid unnecessary access to sibling device objects
This commit is contained in:
parent
bc30c4201a
commit
c640c7954b
@ -1 +1 @@
|
|||||||
#define Cdrskin_timestamP "2008.08.30.104339"
|
#define Cdrskin_timestamP "2008.09.09.131915"
|
||||||
|
@ -729,7 +729,6 @@ static int is_scsi_drive(char *fname, int *bus_no, int *host_no,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CDROM_DRIVE_STATUS
|
#ifdef CDROM_DRIVE_STATUS
|
||||||
if (strcmp(linux_sg_device_family,"/dev/sg%d") != 0) {
|
|
||||||
/* http://developer.osdl.org/dev/robustmutexes/
|
/* http://developer.osdl.org/dev/robustmutexes/
|
||||||
src/fusyn.hg/Documentation/ioctl/cdrom.txt */
|
src/fusyn.hg/Documentation/ioctl/cdrom.txt */
|
||||||
sid_ret = ioctl(fd, CDROM_DRIVE_STATUS, 0);
|
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;
|
sid.scsi_type = TYPE_ROM;
|
||||||
else
|
else
|
||||||
sid_ret = -1;
|
sid_ret = -1;
|
||||||
}
|
|
||||||
#endif /* CDROM_DRIVE_STATUS */
|
#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.
|
/* 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)
|
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];
|
char msg[BURN_DRIVE_ADR_LEN + 80];
|
||||||
struct stat stbuf;
|
struct stat stbuf;
|
||||||
|
|
||||||
|
if (!(flag & 2))
|
||||||
if (fname_drive_is_listed(fname, 0))
|
if (fname_drive_is_listed(fname, 0))
|
||||||
return 2;
|
return 2;
|
||||||
if (stat(fname, &stbuf) == -1) {
|
if (stat(fname, &stbuf) == -1) {
|
||||||
@ -1183,7 +1183,7 @@ static int single_enumerate(int flag)
|
|||||||
fname= burn_drive_whitelist_item(0, 0);
|
fname= burn_drive_whitelist_item(0, 0);
|
||||||
if (fname == NULL)
|
if (fname == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
ret = fname_enumerate(fname, 0);
|
ret = fname_enumerate(fname, 2);
|
||||||
if (ret <= 0) {
|
if (ret <= 0) {
|
||||||
sprintf(msg, "Cannot access '%s' as SG_IO CDROM drive", fname);
|
sprintf(msg, "Cannot access '%s' as SG_IO CDROM drive", fname);
|
||||||
libdax_msgs_submit(libdax_messenger, -1, 0x0002000a,
|
libdax_msgs_submit(libdax_messenger, -1, 0x0002000a,
|
||||||
|
Loading…
Reference in New Issue
Block a user