1 Index: native/jni/java-net/local.c
2 ===================================================================
3 RCS file: /sources/classpath/classpath/native/jni/java-net/local.c,v
4 retrieving revision 1.4
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
9 return socket (PF_UNIX, stream ? SOCK_STREAM : SOCK_DGRAM, 0);
12 -static int gcc_sucks = 0;
15 local_bind (int fd, const char *addr)
17 struct sockaddr_un saddr;
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! */
23 - fprintf (stderr, "bind %p\n", addr);
25 - if (strlen (addr) > sizeof (saddr.sun_path))
26 + if (strlen (addr) >= sizeof (saddr.sun_path))
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;
37 return bind (fd, (struct sockaddr *) &saddr, SUN_LEN (&saddr));