* file named AUTHORS, in the root directory of this distribution.
*/
/*
- * $Id: scsi-solaris.c,v 1.1.2.18.4.1.2.5 2003/01/26 19:20:57 martinea Exp $
+ * $Id: scsi-solaris.c,v 1.25 2005/10/15 13:20:47 martinea Exp $
*
* Interface to execute SCSI commands on an Sun Workstation
*
void SCSI_OS_Version()
{
#ifndef lint
- static char rcsid[] = "$Id: scsi-solaris.c,v 1.1.2.18.4.1.2.5 2003/01/26 19:20:57 martinea Exp $";
+ static char rcsid[] = "$Id: scsi-solaris.c,v 1.25 2005/10/15 13:20:47 martinea Exp $";
DebugPrint(DEBUG_INFO, SECTION_INFO, "scsi-os-layer: %s\n",rcsid);
#endif
}
if (pDev[ip].inqdone == 0)
{
pDev[ip].inqdone = 1;
- if ((DeviceFD = open(pDev[ip].dev, O_RDWR| O_NONBLOCK)) > 0)
+ if ((DeviceFD = open(pDev[ip].dev, O_RDWR| O_NONBLOCK)) >= 0)
{
pDev[ip].avail = 1;
pDev[ip].fd = DeviceFD;
return(0);
}
} else {
- if ((DeviceFD = open(pDev[ip].dev, O_RDWR| O_NDELAY)) > 0)
+ if ((DeviceFD = open(pDev[ip].dev, O_RDWR| O_NDELAY)) >= 0)
{
pDev[ip].fd = DeviceFD;
pDev[ip].devopen = 1;
while (retries > 0)
{
if (pDev[DeviceFD].devopen == 0)
- SCSI_OpenDevice(DeviceFD);
+ if (SCSI_OpenDevice(DeviceFD) == 0)
+ {
+ sleep(1);
+ continue;
+ }
if ((ret = ioctl(pDev[DeviceFD].fd, USCSICMD, &Command)) >= 0)
{
int ret = 0;
if (pDev[DeviceFD].devopen == 0)
- {
- SCSI_OpenDevice(DeviceFD);
- }
+ if (SCSI_OpenDevice(DeviceFD) == 0)
+ return(-1);
switch (command)
{
int ret = -1;
if (pDev[DeviceFD].devopen == 0)
- {
- SCSI_OpenDevice(DeviceFD);
- }
+ if (SCSI_OpenDevice(DeviceFD) == 0)
+ return(-1);
if (ioctl(pDev[DeviceFD].fd , MTIOCGET, &mtget) != 0)
{