Added: trunk/dports/sysutils/cdrdao/files/patch-dao_ScsiIf-osx.cc.diff (0 => 74247)
--- trunk/dports/sysutils/cdrdao/files/patch-dao_ScsiIf-osx.cc.diff (rev 0)
+++ trunk/dports/sysutils/cdrdao/files/patch-dao_ScsiIf-osx.cc.diff 2010-12-09 01:18:54 UTC (rev 74247)
@@ -0,0 +1,202 @@
+--- dao/ScsiIf-osx.cc.orig 2009-02-22 21:47:01.000000000 +1100
++++ dao/ScsiIf-osx.cc 2010-12-09 12:11:48.000000000 +1100
+@@ -18,7 +18,7 @@
+ /* cdrdao specific includes and prototype */
+ #include "ScsiIf.h"
+ #include "trackdb/util.h"
+-extern void message(int level, const char *fmt, ...);
++#include "log.h"
+ #include "decodeSense.cc"
+
+ /* Mac OS X specific includes */
+@@ -120,7 +120,7 @@ int ScsiIf::init()
+ CFSTR(kIOPropertySCSITaskAuthoringDevice));
+ CFDictionarySetValue(dict, CFSTR(kIOPropertyMatchKey), sub);
+ IOServiceGetMatchingServices(kIOMasterPortDefault, dict, &iterator);
+- if (!iterator) message(-2, "init: no iterator");
++ if (!iterator) log_message(-2, "init: no iterator");
+ if (iterator) {
+ i = impl_->num_;
+ do {
+@@ -134,16 +134,16 @@ int ScsiIf::init()
+ impl_->object_ = IORegistryEntryFromPath(kIOMasterPortDefault, impl_->path_);
+ }
+ /* Strange if (!x) ... if (x) style so you can #ifdef out the !x part */
+- if (!impl_->object_) message(-2, "init: no object");
++ if (!impl_->object_) log_message(-2, "init: no object");
+ if (impl_->object_) {
+ /* Get intermediate (IOCFPlugIn) plug-in for MMC device */
+ err = IOCreatePlugInInterfaceForService(impl_->object_,
+ kIOMMCDeviceUserClientTypeID, kIOCFPlugInInterfaceID,
+ &impl_->plugin_, &score);
+ if (err != noErr)
+- message(-2, "init: IOCreatePlugInInterfaceForService failed: %d", err);
++ log_message(-2, "init: IOCreatePlugInInterfaceForService failed: %d", err);
+ }
+- if (!impl_->plugin_) message(-2, "init: no plugin");
++ if (!impl_->plugin_) log_message(-2, "init: no plugin");
+ if (impl_->plugin_) {
+ /* Get the MMC interface (MMCDeviceInterface) */
+ herr = (*impl_->plugin_)->QueryInterface(impl_->plugin_,
+@@ -154,29 +154,29 @@ int ScsiIf::init()
+ */
+ (LPVOID *)&impl_->mmc_);
+ if (herr != S_OK)
+- message(-2, "init: QueryInterface failed: %d", herr);
++ log_message(-2, "init: QueryInterface failed: %d", herr);
+ }
+- if (!impl_->mmc_) message(-2, "init: no mmc");
++ if (!impl_->mmc_) log_message(-2, "init: no mmc");
+ if (impl_->mmc_) {
+ /* Get the SCSI interface */
+ impl_->scsi_ = (*impl_->mmc_)->GetSCSITaskDeviceInterface(impl_->mmc_);
+ }
+- if (!impl_->scsi_) message(-2, "init: no scsi");
++ if (!impl_->scsi_) log_message(-2, "init: no scsi");
+ if (impl_->scsi_) {
+ /* Obtain exclusive access to device */
+ err = (*impl_->scsi_)->ObtainExclusiveAccess(impl_->scsi_);
+ if (err != noErr)
+- message(-2, "init: ObtainExclusiveAccess failed: %d", err);
++ log_message(-2, "init: ObtainExclusiveAccess failed: %d", err);
+ if (err == noErr) {
+ impl_->exclusive_ = 1;
+ /* Send SCSI inquiry command */
+ i = inquiry();
+ if (i != 0)
+- message(-2, "init: inquiry failed: %d", i);
++ log_message(-2, "init: inquiry failed: %d", i);
+ return (i == 0) ? 0 : 2;
+ }
+ }
+- message(-2, "init: failed");
++ log_message(-2, "init: failed");
+ return 1;
+ }
+
+@@ -311,7 +311,7 @@ void ScsiIf::printError()
+ default:
+ s = "unknown response"; break;
+ }
+- if (s) message(-2, s);
++ if (s) log_message(-2, s);
+ }
+
+ /*
+@@ -334,7 +334,7 @@ int inq(SCSITaskDeviceInterface **scsi,
+
+ task = (*scsi)->CreateSCSITask(scsi);
+ if (!task) {
+- message(-2, "inq: no task");
++ log_message(-2, "inq: no task");
+ return 1;
+ }
+ bzero(cdb, sizeof(cdb));
+@@ -342,7 +342,7 @@ int inq(SCSITaskDeviceInterface **scsi,
+ cdb[4] = sizeof(inq_data);
+ ret = (*task)->SetCommandDescriptorBlock(task, cdb, kSCSICDBSize_6Byte);
+ if (ret != kIOReturnSuccess) {
+- message(-2, "inq: SetCommandDescriptorBlock failed: %d", ret);
++ log_message(-2, "inq: SetCommandDescriptorBlock failed: %d", ret);
+ (*task)->Release(task);
+ return 1;
+ }
+@@ -351,35 +351,35 @@ int inq(SCSITaskDeviceInterface **scsi,
+ ret = (*task)->SetScatterGatherEntries(task, &range, 1,
+ sizeof(inq_data), kSCSIDataTransfer_FromTargetToInitiator);
+ if (ret != kIOReturnSuccess) {
+- message(-2, "inq: SetScatterGatherEntries failed: %d", ret);
++ log_message(-2, "inq: SetScatterGatherEntries failed: %d", ret);
+ (*task)->Release(task);
+ return 1;
+ }
+ ret = (*task)->SetTimeoutDuration(task, 1000);
+ if (ret != kIOReturnSuccess) {
+- message(-2, "inq: SetTimeoutDuration failed: %d", ret);
++ log_message(-2, "inq: SetTimeoutDuration failed: %d", ret);
+ (*task)->Release(task);
+ return 1;
+ }
+ ret = (*task)->ExecuteTaskSync(task, sense, status, &len);
+ if (ret != kIOReturnSuccess) {
+- message(-2, "inq: ExecuteTaskSync failed: %d", ret);
++ log_message(-2, "inq: ExecuteTaskSync failed: %d", ret);
+ (*task)->Release(task);
+ return 1;
+ }
+ ret = (*task)->GetSCSIServiceResponse(task, response);
+ if (ret != kIOReturnSuccess) {
+- message(-2, "inq: GetSCSIServiceResponse failed: %d", ret);
++ log_message(-2, "inq: GetSCSIServiceResponse failed: %d", ret);
+ (*task)->Release(task);
+ return 1;
+ }
+ if (*response != kSCSIServiceResponse_TASK_COMPLETE) {
+- message(-2, "inq: response=%d", *response);
++ log_message(-2, "inq: response=%d", *response);
+ (*task)->Release(task);
+ return 1;
+ }
+ if (*status != kSCSITaskStatus_GOOD) {
+- message(-2, "inq: status=%d", *status);
++ log_message(-2, "inq: status=%d", *status);
+ (*task)->Release(task);
+ return 1;
+ }
+@@ -437,7 +437,7 @@ ScsiIf::ScanData *ScsiIf::scan(int *len,
+ CFDictionarySetValue(dict, CFSTR(kIOPropertyMatchKey), sub);
+ IOServiceGetMatchingServices(kIOMasterPortDefault, dict, &iterator);
+ if (!iterator) {
+- message(-2, "scan: no iterator");
++ log_message(-2, "scan: no iterator");
+ *len = 0;
+ return NULL;
+ }
+@@ -456,32 +456,32 @@ ScsiIf::ScanData *ScsiIf::scan(int *len,
+ kIOMMCDeviceUserClientTypeID, kIOCFPlugInInterfaceID,
+ &plugin, &score);
+ if (err != noErr) {
+- message(-2, "scan: IOCreatePlugInInterfaceForService failed: %d", err);
++ log_message(-2, "scan: IOCreatePlugInInterfaceForService failed: %d", err);
+ goto clean;
+ }
+ if (!plugin) {
+- message(-2, "scan: no plugin");
++ log_message(-2, "scan: no plugin");
+ goto clean;
+ }
+ herr = (*plugin)->QueryInterface(plugin,
+ CFUUIDGetUUIDBytes(kIOMMCDeviceInterfaceID),
+ (LPVOID *)&mmc);
+ if (herr != S_OK) {
+- message(-2, "scan: QueryInterface failed: %d", herr);
++ log_message(-2, "scan: QueryInterface failed: %d", herr);
+ goto clean;
+ }
+ if (!mmc) {
+- message(-2, "scan: no mmc");
++ log_message(-2, "scan: no mmc");
+ goto clean;
+ }
+ scsi = (*mmc)->GetSCSITaskDeviceInterface(mmc);
+ if (!scsi) {
+- message(-2, "scan: no scsi");
++ log_message(-2, "scan: no scsi");
+ goto clean;
+ }
+ err = (*scsi)->ObtainExclusiveAccess(scsi);
+ if (err != noErr) {
+- message(-2, "scan: ObtainExclusiveAccess failed: %d", err);
++ log_message(-2, "scan: ObtainExclusiveAccess failed: %d", err);
+ goto clean;
+ }
+ ret = inq(scsi, &response, &status, NULL,
+@@ -489,7 +489,7 @@ ScsiIf::ScanData *ScsiIf::scan(int *len,
+ scanData[*len].product,
+ scanData[*len].revision);
+ if (ret != 0) {
+- message(-2, "scan: inq failed: %d", ret);
++ log_message(-2, "scan: inq failed: %d", ret);
+ goto clean;
+ }
+ (*len)++;