Imported Upstream version 0.72.4

This commit is contained in:
TANIGUCHI Takaki
2012-04-08 21:33:59 +09:00
parent cef31abc8c
commit 2f23ea4b4a
1170 changed files with 116562 additions and 55295 deletions

View File

@@ -1,5 +1,5 @@
/* dvdisaster: Additional error correction for optical media.
* Copyright (C) 2004-2011 Carsten Gnoerlich.
* Copyright (C) 2004-2012 Carsten Gnoerlich.
* Project home page: http://www.dvdisaster.com
* Email: carsten@dvdisaster.com -or- cgnoerlich@fsfe.org
*
@@ -106,6 +106,13 @@ DeviceHandle* OpenDevice(char *device)
dh = g_malloc0(sizeof(DeviceHandle));
/* Make sure we do not overrun any memory due
to differently sized sense structures */
dh->senseSize = sizeof(Sense);
if(dh->senseSize > sizeof(struct scsi_sense_data))
dh->senseSize = sizeof(struct scsi_sense_data);
dh->camdev = cam_open_pass(device, O_RDWR, NULL);
if(!dh->camdev)
@@ -177,7 +184,6 @@ int SendPacket(DeviceHandle *dh, unsigned char *cmd, int cdb_size, unsigned char
Stop("illegal data_mode: %d", data_mode);
}
cam_fill_csio(&ccb->csio, 1, NULL, flags, CAM_TAG_ACTION_NONE,//MSG_SIMPLE_Q_TAG,
buf, size, sizeof(struct scsi_sense_data), cdb_size,
120*1000); /* 120 secs timeout */
@@ -194,7 +200,7 @@ int SendPacket(DeviceHandle *dh, unsigned char *cmd, int cdb_size, unsigned char
/* Extract sense data */
memcpy(sense, &(ccb->csio.sense_data), sizeof(struct scsi_sense_data));
memcpy(sense, &(ccb->csio.sense_data), dh->senseSize);
if((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP)
return 0;
@@ -204,8 +210,6 @@ int SendPacket(DeviceHandle *dh, unsigned char *cmd, int cdb_size, unsigned char
status = ccb->csio.scsi_status;
return -1;
}
#endif /* SYS_FREEBSD */