[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cp-testresults] classpath daily snapshot 20061009 FAILED
From: |
Tom Tromey |
Subject: |
Re: [cp-testresults] classpath daily snapshot 20061009 FAILED |
Date: |
09 Oct 2006 10:40:41 -0600 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 |
>>>>> "Michael" == Michael Koch <address@hidden> writes:
Michael> The question is now: Do we want to support glibc (and
Michael> probably other libc's for embedded targets) that lack this
Michael> method? Perhaps we can just throw some exception on these
Michael> systems.
Yeah. Try this patch.
Tom
Index: ChangeLog
from Tom Tromey <address@hidden>
* native/jni/java-net/java_net_VMNetworkInterface.c: Conditionally
include ifaddrs.h.
(Java_java_net_VMNetworkInterface_getVMInterfaces): Updated
conditional.
* native/jni/java-net/gnu_java_net_VMPlainSocketImpl.c:
Conditionally include ifaddrs.h.
(getif_address): Updated conditional.
(getif_index): Likewise.
* configure.ac: Check for ifaddrs.h.
Index: configure.ac
===================================================================
RCS file: /cvsroot/classpath/classpath/configure.ac,v
retrieving revision 1.188
diff -u -r1.188 configure.ac
--- configure.ac 27 Sep 2006 17:02:24 -0000 1.188
+++ configure.ac 9 Oct 2006 16:47:30 -0000
@@ -357,7 +357,8 @@
fcntl.h \
sys/mman.h \
magic.h \
- sys/event.h sys/epoll.h])
+ sys/event.h sys/epoll.h \
+ ifaddrs.h])
AC_EGREP_HEADER(uint32_t, stdint.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define
to 1 if you have uint32_t]))
AC_EGREP_HEADER(uint32_t, inttypes.h, AC_DEFINE(HAVE_INT32_DEFINED, 1,
[Define to 1 if you have uint32_t]))
Index: native/jni/java-net/gnu_java_net_VMPlainSocketImpl.c
===================================================================
RCS file:
/cvsroot/classpath/classpath/native/jni/java-net/gnu_java_net_VMPlainSocketImpl.c,v
retrieving revision 1.11
diff -u -r1.11 gnu_java_net_VMPlainSocketImpl.c
--- native/jni/java-net/gnu_java_net_VMPlainSocketImpl.c 9 Oct 2006 11:10:41
-0000 1.11
+++ native/jni/java-net/gnu_java_net_VMPlainSocketImpl.c 9 Oct 2006 16:47:32
-0000
@@ -44,7 +44,9 @@
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/time.h>
+#ifdef HAVE_IFADDRS_H
#include <ifaddrs.h>
+#endif
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <errno.h>
@@ -766,7 +768,7 @@
static uint32_t
getif_address (JNIEnv *env, const char *ifname)
{
-#ifdef HAVE_GETIFADDRS
+#if defined (HAVE_IFADDRS_H) && defined (HAVE_GETIFADDRS)
struct ifaddrs *ifaddrs, *i;
uint32_t addr = 0;
int foundaddr = 0;
@@ -802,13 +804,13 @@
JCL_ThrowException (env, "java/lang/InternalError",
"getifaddrs not available");
return 0;
-#endif /* HAVE_GETIFADDRS */
+#endif /* HAVE_IFADDRS_H && HAVE_GETIFADDRS */
}
static int
getif_index (JNIEnv *env, const char *ifname)
{
-#ifdef HAVE_GETIFADDRS
+#if defined (HAVE_GETIFADDRS) && defined (HAVE_GETIFADDRS)
struct ifaddrs *ifaddrs, *i;
char *lastname = NULL;
int index = 1;
Index: native/jni/java-net/java_net_VMNetworkInterface.c
===================================================================
RCS file:
/cvsroot/classpath/classpath/native/jni/java-net/java_net_VMNetworkInterface.c,v
retrieving revision 1.4
diff -u -r1.4 java_net_VMNetworkInterface.c
--- native/jni/java-net/java_net_VMNetworkInterface.c 17 Sep 2006 07:31:43
-0000 1.4
+++ native/jni/java-net/java_net_VMNetworkInterface.c 9 Oct 2006 16:47:32 -0000
@@ -41,7 +41,9 @@
#include <sys/types.h>
#include <sys/socket.h>
+#ifde HAVE_IFADDRS_H
#include <ifaddrs.h>
+#endif
#include <netinet/in.h>
#include <errno.h>
#include <stdlib.h>
@@ -111,7 +113,7 @@
JNIEXPORT jobjectArray JNICALL
Java_java_net_VMNetworkInterface_getVMInterfaces (JNIEnv * env, jclass clazz)
{
-#ifdef HAVE_GETIFADDRS
+#if defined (HAVE_IFADDRS_H) && defined (HAVE_GETIFADDRS)
struct ifaddrs *ifaddrs, *i;
struct netif_entry *iflist = NULL, *e;
jobjectArray netifs;