summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2008-02-17 07:54:19 +0000
committerMike Frysinger <vapier@gentoo.org>2008-02-17 07:54:19 +0000
commitee4209a465a7ce467128c6d0bf6b04780a0af1d1 (patch)
tree9a333976b2de657d549949522cd4628ece70e489 /app-cdr/dvd+rw-tools/files
parentAdd missing m4 dependency and fixup flag munging. (diff)
downloadgentoo-2-ee4209a465a7ce467128c6d0bf6b04780a0af1d1.tar.gz
gentoo-2-ee4209a465a7ce467128c6d0bf6b04780a0af1d1.tar.bz2
gentoo-2-ee4209a465a7ce467128c6d0bf6b04780a0af1d1.zip
Fix running of growisofs on systems with large thread stacks (like powerpc).
(Portage version: 2.2_pre2)
Diffstat (limited to 'app-cdr/dvd+rw-tools/files')
-rw-r--r--app-cdr/dvd+rw-tools/files/dvd+rw-tools-7.0-thread-stack-size.patch41
1 files changed, 41 insertions, 0 deletions
diff --git a/app-cdr/dvd+rw-tools/files/dvd+rw-tools-7.0-thread-stack-size.patch b/app-cdr/dvd+rw-tools/files/dvd+rw-tools-7.0-thread-stack-size.patch
new file mode 100644
index 000000000000..ab0f1173634a
--- /dev/null
+++ b/app-cdr/dvd+rw-tools/files/dvd+rw-tools-7.0-thread-stack-size.patch
@@ -0,0 +1,41 @@
+Respect PTHREAD_STACK_MIN when defined
+
+Some systems (like PowerPC) cannot work with 64k thread stacks. Setting the
+stack lower will error and the whole process aborts. An example error:
+$ growisofs -dvd-compat -Z /dev/hda=my.iso
+Executing 'builtin_dd if=my.iso of=/dev/hda obs=32k seek=0'
+:-( failed to create thread: Input/output error
+
+So if the minimum required size is larger than 64k, we'll just use whatever
+the system defines. If it is smaller, we'll stick with 64k.
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+
+--- dvd+rw-tools-7.0/mp.h
++++ dvd+rw-tools-7.0/mp.h
+@@ -31,6 +31,16 @@
+ #include <sched.h>
+ #include <semaphore.h>
+ #include <stdlib.h>
++#include <limits.h>
++
++/* some systems (like powerpc) cannot work with 64k stacks */
++#define MY_STACK_SIZE 64*1024
++#ifdef PTHREAD_STACK_MIN
++# if MY_STACK_SIZE < PTHREAD_STACK_MIN
++# undef MY_STACK_SIZE
++# define MY_STACK_SIZE PTHREAD_STACK_MIN
++# endif
++#endif
+
+ #define THR_TYPE int
+
+@@ -39,7 +49,7 @@
+ pthread_attr_t attr;
+
+ if (pthread_attr_init(&attr)==0 &&
+- pthread_attr_setstacksize(&attr,64*1024)==0 &&
++ pthread_attr_setstacksize(&attr,MY_STACK_SIZE)==0 &&
+ pthread_attr_setscope(&attr,PTHREAD_SCOPE_SYSTEM)==0 &&
+ pthread_create(&h,&attr,(void *(*)(void *))func,arg)==0 )
+ return (void *)h;