summaryrefslogtreecommitdiffstats
path: root/recipes-core/classpath/classpath-0.98/javanet-local.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-core/classpath/classpath-0.98/javanet-local.patch')
-rw-r--r--recipes-core/classpath/classpath-0.98/javanet-local.patch37
1 files changed, 37 insertions, 0 deletions
diff --git a/recipes-core/classpath/classpath-0.98/javanet-local.patch b/recipes-core/classpath/classpath-0.98/javanet-local.patch
new file mode 100644
index 0000000..b8d1584
--- /dev/null
+++ b/recipes-core/classpath/classpath-0.98/javanet-local.patch
@@ -0,0 +1,37 @@
1Index: native/jni/java-net/local.c
2===================================================================
3RCS file: /sources/classpath/classpath/native/jni/java-net/local.c,v
4retrieving revision 1.4
5diff -u -r1.4 local.c
6--- native/jni/java-net/local.c 17 Apr 2007 21:46:27 -0000 1.4
7+++ native/jni/java-net/local.c 27 Jun 2008 13:14:40 -0000
8@@ -73,27 +73,18 @@
9 return socket (PF_UNIX, stream ? SOCK_STREAM : SOCK_DGRAM, 0);
10 }
11
12-static int gcc_sucks = 0;
13-
14 int
15 local_bind (int fd, const char *addr)
16 {
17 struct sockaddr_un saddr;
18
19- /* For some reason, GCC 4.0.1 on Darwin/x86 MODIFIES the `addr'
20- pointer in the CALLER's STACK FRAME after calling this function,
21- but if we add this statement below, it doesn't! */
22- if (gcc_sucks)
23- fprintf (stderr, "bind %p\n", addr);
24-
25- if (strlen (addr) > sizeof (saddr.sun_path))
26+ if (strlen (addr) >= sizeof (saddr.sun_path))
27 {
28 errno = ENAMETOOLONG;
29 return -1;
30 }
31
32- strncpy (saddr.sun_path, addr, sizeof (saddr.sun_path));
33- saddr.sun_path[sizeof (saddr.sun_path)] = '\0';
34+ strcpy (saddr.sun_path, addr);
35 saddr.sun_family = AF_LOCAL;
36
37 return bind (fd, (struct sockaddr *) &saddr, SUN_LEN (&saddr));