mxcl/homebrew — Issue #10091: patches to cdrtools from dvd+rw-tools
Author: arezeeman
Created: 2012-02-10 08:27:47+00:00
State: open

I spent the day trying to get mkisofs (from cdrtools) and growisofs (from dvd+rw-tools) to do their thing and came across a couple of patches that should be applied to cdrtools.

The first one is necessary for the two packages to work together. Without it, "growisofs -M" doesn't work. The necessary patch is in growisofs.c.

/*
* Even though /dev/fd/N is present on Mac OS X we can't pass it
* to mkisofs for following reason. The trouble is that in order
* to ObtainExclusiveAccess, which is required for raw SCSI, no
* /dev/[r]diskN descriptors may be open by that time. Now, if
* I pass /dev/fd/N, mkisofs would reopen it and close only this
* duplicate descriptor leaving original N open. Therefore I
* pass -M - to allow mkisofs to simply take stdin and close it
* when it's done with previous session directory scructure.
* Needless to mention that mkisofs has to be patched to accept
* dash as -M argument:

--- mkisofs/multi.c.orig 2004-05-15 18:59:40.000000000 +0200
+++ mkisofs/multi.c 2006-09-11 23:50:23.000000000 +0200
@@ -1137,6 +1137,14 @@
open_merge_image(path)
char *path;
{
+ if (path[0]=='-' && path[1]=='\0') {
+#ifdef NEED_O_BINARY
+ setmode(fileno(stdin),O_BINARY);
+#endif
+ in_image = stdin;
+ return (0);
+ }
+
#ifndef USE_SCG
in_image = fopen(path, "rb");
if (in_image == NULL) {
\-\-\-
*/

I came across another patch that seems like it could be significant, since it claims to fix an unintitalized variable. It's from fink:

> There's a missing initialization in libscg/scsi-mac-iokit.c; masterPort is never set to zero, so unless that particular part of the heap is already zero, the call to IOMasterPort never takes place.

See http://osdir.com/ml/fink-users-osx-unix/2011-05/msg00004.html

Both patches are mac-specific, so it seems like homebrew should apply them, yes?