This fixes an issue with importing FIONREAD on Solaris. We do things right in cpio.c but not in some other files.
ChangeLog: 2007-04-17 Andrew John Hughes <[EMAIL PROTECTED]> * native/jni/java-net/local.c: Fix import of FIONREAD. * native/jni/java-nio/gnu_java_nio_VMChannel.c, * native/jni/native-lib/cpnet.c: Likewise. -- Andrew :-) Escape the Java Trap with GNU Classpath! http://www.gnu.org/philosophy/java-trap.html public class gcj extends Freedom implements Java { ... }
Index: native/jni/java-net/local.c =================================================================== RCS file: /cvsroot/classpath/classpath/native/jni/java-net/local.c,v retrieving revision 1.3 diff -u -3 -p -u -r1.3 local.c --- native/jni/java-net/local.c 21 Aug 2006 09:40:13 -0000 1.3 +++ native/jni/java-net/local.c 17 Apr 2007 21:29:28 -0000 @@ -45,13 +45,20 @@ exception statement from your version. #include <unistd.h> #include <string.h> #include <errno.h> -#include <sys/ioctl.h> #include <sys/types.h> #include <sys/socket.h> #include <sys/un.h> #include <stdio.h> +#if defined(HAVE_SYS_IOCTL_H) +#define BSD_COMP /* Get FIONREAD on Solaris2 */ +#include <sys/ioctl.h> +#endif +#if defined(HAVE_SYS_FILIO_H) /* Get FIONREAD on Solaris 2.5 */ +#include <sys/filio.h> +#endif + #include "local.h" const char * Index: native/jni/java-nio/gnu_java_nio_VMChannel.c =================================================================== RCS file: /cvsroot/classpath/classpath/native/jni/java-nio/gnu_java_nio_VMChannel.c,v retrieving revision 1.16 diff -u -3 -p -u -r1.16 gnu_java_nio_VMChannel.c --- native/jni/java-nio/gnu_java_nio_VMChannel.c 28 Mar 2007 09:48:06 -0000 1.16 +++ native/jni/java-nio/gnu_java_nio_VMChannel.c 17 Apr 2007 21:29:28 -0000 @@ -43,7 +43,6 @@ exception statement from your version. * #include <config-int.h> #include <sys/types.h> -#include <sys/ioctl.h> #include <sys/mman.h> #include <sys/socket.h> #include <sys/stat.h> @@ -67,6 +66,14 @@ exception statement from your version. * #include <fcntl.h> #endif /* HAVE_FCNTL_H */ +#if defined(HAVE_SYS_IOCTL_H) +#define BSD_COMP /* Get FIONREAD on Solaris2 */ +#include <sys/ioctl.h> +#endif +#if defined(HAVE_SYS_FILIO_H) /* Get FIONREAD on Solaris 2.5 */ +#include <sys/filio.h> +#endif + #define CONNECT_EXCEPTION "java/net/ConnectException" #define IO_EXCEPTION "java/io/IOException" #define SOCKET_EXCEPTION "java/net/SocketException" Index: native/jni/native-lib/cpnet.c =================================================================== RCS file: /cvsroot/classpath/classpath/native/jni/native-lib/cpnet.c,v retrieving revision 1.6 diff -u -3 -p -u -r1.6 cpnet.c --- native/jni/native-lib/cpnet.c 20 Jan 2007 03:24:19 -0000 1.6 +++ native/jni/native-lib/cpnet.c 17 Apr 2007 21:29:28 -0000 @@ -46,11 +46,18 @@ exception statement from your version. * #include <netinet/in.h> #include <netinet/tcp.h> #include <netdb.h> -#include <sys/ioctl.h> #include <sys/time.h> #include <unistd.h> #include <arpa/inet.h> +#if defined(HAVE_SYS_IOCTL_H) +#define BSD_COMP /* Get FIONREAD on Solaris2 */ +#include <sys/ioctl.h> +#endif +#if defined(HAVE_SYS_FILIO_H) /* Get FIONREAD on Solaris 2.5 */ +#include <sys/filio.h> +#endif + #include "cpnet.h" #define SOCKET_DEFAULT_TIMEOUT -1 /* milliseconds */
signature.asc
Description: Digital signature