Used O_EXCL|O_RDWR and fcntl() even within sg_obtain_scsi_adr()
This commit is contained in:
parent
1588a02e44
commit
bf0f065be0
@ -1 +1 @@
|
|||||||
#define Cdrskin_timestamP "2007.04.10.081855"
|
#define Cdrskin_timestamP "2007.04.10.082229"
|
||||||
|
@ -1149,7 +1149,7 @@ ex:;
|
|||||||
int sg_obtain_scsi_adr(char *path, int *bus_no, int *host_no, int *channel_no,
|
int sg_obtain_scsi_adr(char *path, int *bus_no, int *host_no, int *channel_no,
|
||||||
int *target_no, int *lun_no)
|
int *target_no, int *lun_no)
|
||||||
{
|
{
|
||||||
int fd, ret, l;
|
int fd, ret, l, open_mode = O_RDWR | O_NONBLOCK;
|
||||||
struct my_scsi_idlun {
|
struct my_scsi_idlun {
|
||||||
int x;
|
int x;
|
||||||
int host_unique_id;
|
int host_unique_id;
|
||||||
@ -1164,7 +1164,12 @@ int sg_obtain_scsi_adr(char *path, int *bus_no, int *host_no, int *channel_no,
|
|||||||
/* ts A70409 : DDLP */
|
/* ts A70409 : DDLP */
|
||||||
/* >>> obtain single lock on path */
|
/* >>> obtain single lock on path */
|
||||||
|
|
||||||
fd = open(path, O_RDONLY | O_NONBLOCK);
|
if(burn_sg_open_o_excl)
|
||||||
|
open_mode |= O_EXCL;
|
||||||
|
fd = open(path, open_mode);
|
||||||
|
if(fd < 0)
|
||||||
|
return 0;
|
||||||
|
sg_fcntl_lock(&fd, path);
|
||||||
if(fd < 0)
|
if(fd < 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user