Package: jack-audio-connection-kit
Version: 0.100.0-2

Hi,

the following patch makes it possible to compile the sources on systems where PATH_MAX isn't defined (ie: it allows to get packages on GNU/Hurd!).

Notice that this patch works by basically defining PATH_MAX to 1024 for those systems ; which is a pretty lame way to do a port. Usually, nice ports are done by replacing static allocations "char foo[PATH_MAX+whatever]" with dynamic allocations "char *foo"+malloc+free.

In this case however it is impossible: some of the structures containing char foo[PATH_MAX+1] members are transmitted through file descriptors, which makes it impossible to replace with char *foo...

It would require a rewrite of the part of libjack responsible of client-server communication to make a serious PATH_MAX-less port possible.

Work for upstream?

J.P.
diff -ur jack-audio-connection-kit-0.100.0/jack/internal.h jack-audio-connection-kit-0.100.0.patched/jack/internal.h
--- jack-audio-connection-kit-0.100.0/jack/internal.h	2005-05-12 16:58:15.000000000 +0200
+++ jack-audio-connection-kit-0.100.0.patched/jack/internal.h	2005-07-31 17:23:16.000000000 +0200
@@ -49,6 +49,14 @@
 #include <sysdeps/mach_port.h>
 #endif
 
+#ifndef PATH_MAX
+ #ifdef MAXPATHLEN
+   #define PATH_MAX MAXPATHLEN
+ #else
+  #define PATH_MAX 1024
+ #endif /* MAXPATHLEN */
+#endif /* !PATH_MAX */
+
 #ifdef DEBUG_ENABLED
 #define DEBUG(format,args...) \
 	fprintf (stderr, "jack:%5d:%" PRIu64 " %s:%s:%d: " format "\n", getpid(), jack_get_microseconds(), __FILE__, __FUNCTION__, __LINE__ , ## args)
diff -ur jack-audio-connection-kit-0.100.0/libjack/unlock.c jack-audio-connection-kit-0.100.0.patched/libjack/unlock.c
--- jack-audio-connection-kit-0.100.0/libjack/unlock.c	2005-05-03 15:31:52.000000000 +0200
+++ jack-audio-connection-kit-0.100.0.patched/libjack/unlock.c	2005-07-31 17:23:46.000000000 +0200
@@ -27,6 +27,14 @@
 
 #include "jack/unlock.h"
 
+#ifndef PATH_MAX
+ #ifdef MAXPATHLEN
+   #define PATH_MAX MAXPATHLEN
+ #else
+  #define PATH_MAX 1024
+ #endif /* MAXPATHLEN */
+#endif /* !PATH_MAX */
+
 static char* blacklist[] = {
 	"/libgtk",
 	"/libqt",

Reply via email to