X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=changer-src%2Fscsi-cam.c;fp=changer-src%2Fscsi-cam.c;h=e159b45facf8ab30b2f46051e2badf4f1deef105;hb=1194fb66aa28d9929c3f2bef3cc6c1c3f40a60a4;hp=df966bd537e16e5661b57258f15ebd39c47466d1;hpb=2df780bff19c457b0debb7adc29972a0bc2a5dc2;p=debian%2Famanda diff --git a/changer-src/scsi-cam.c b/changer-src/scsi-cam.c index df966bd..e159b45 100644 --- a/changer-src/scsi-cam.c +++ b/changer-src/scsi-cam.c @@ -24,7 +24,7 @@ * file named AUTHORS, in the root directory of this distribution. */ /* - * $Id: scsi-cam.c,v 1.10.4.1.2.3.2.1 2004/04/29 20:47:21 martinea Exp $ + * $Id: scsi-cam.c,v 1.14 2005/10/15 13:20:47 martinea Exp $ * * Interface to execute SCSI commands on an system with cam support * Current support is for FreeBSD 4.x @@ -75,7 +75,7 @@ extern FILE *debug_file; void SCSI_OS_Version() { #ifndef lint - static char rcsid[] = "$Id: scsi-cam.c,v 1.10.4.1.2.3.2.1 2004/04/29 20:47:21 martinea Exp $"; + static char rcsid[] = "$Id: scsi-cam.c,v 1.14 2005/10/15 13:20:47 martinea Exp $"; DebugPrint(DEBUG_INFO, SECTION_INFO, "scsi-os-layer: %s\n",rcsid); #endif } @@ -283,7 +283,11 @@ int SCSI_ExecuteCommand(int DeviceFD, if (pDev[DeviceFD].devopen == 0) { - SCSI_OpenDevice(DeviceFD); + if (SCSI_OpenDevice(DeviceFD) == 0) + { + cam_freeccb(ccb); + return(SCSI_ERROR); + } } ret = cam_send_ccb(pDev[DeviceFD].curdev, ccb); @@ -322,9 +326,8 @@ int Tape_Ioctl( int DeviceFD, int command) int ret = 0; if (pDev[DeviceFD].devopen == 0) - { - SCSI_OpenDevice(DeviceFD); - } + if (SCSI_OpenDevice(DeviceFD) == 0) + return(-1); switch (command) { @@ -354,9 +357,8 @@ int Tape_Status( int DeviceFD) int ret = 0; if (pDev[DeviceFD].devopen == 0) - { - SCSI_OpenDevice(DeviceFD); - } + if (SCSI_OpenDevice(DeviceFD) == 0) + return(-1); if (ioctl(pDev[DeviceFD].fd , MTIOCGET, &mtget) != 0) {