diff options
author | Mark Wielaard <mark@klomp.org> | 2006-11-26 13:31:26 +0000 |
---|---|---|
committer | Mark Wielaard <mark@klomp.org> | 2006-11-26 13:31:26 +0000 |
commit | 3e50c377c3087bba8e052264c11c4cfccf9b6b55 (patch) | |
tree | 81ee8b31715e5391e31548ac559bf288a9f527c2 | |
parent | 1b8b29e05dae6be1c7bb43e9610c4991c7307dc7 (diff) | |
download | classpath-3e50c377c3087bba8e052264c11c4cfccf9b6b55.tar.gz |
2006-11-26 Tom Tromey <tromey@redhat.com>
* 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.
-rw-r--r-- | ChangeLog | 12 | ||||
-rw-r--r-- | configure.ac | 3 | ||||
-rw-r--r-- | native/jni/java-net/gnu_java_net_VMPlainSocketImpl.c | 8 | ||||
-rw-r--r-- | native/jni/java-net/java_net_VMNetworkInterface.c | 4 |
4 files changed, 22 insertions, 5 deletions
@@ -1,3 +1,15 @@ +2006-11-26 Tom Tromey <tromey@redhat.com> + + * 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. + 2006-11-25 Mark Wielaard <mark@klomp.org> * java/io/File.java (list): Return empty list for unreadable dirs. diff --git a/configure.ac b/configure.ac index 1df2d20ff..acb9d6761 100644 --- a/configure.ac +++ b/configure.ac @@ -357,7 +357,8 @@ if test "x${COMPILE_JNI}" = xyes; then 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])) diff --git a/native/jni/java-net/gnu_java_net_VMPlainSocketImpl.c b/native/jni/java-net/gnu_java_net_VMPlainSocketImpl.c index 53ef04d47..cdfbe7397 100644 --- a/native/jni/java-net/gnu_java_net_VMPlainSocketImpl.c +++ b/native/jni/java-net/gnu_java_net_VMPlainSocketImpl.c @@ -46,7 +46,9 @@ exception statement from your version. */ #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 <net/if.h> @@ -877,7 +879,7 @@ Java_gnu_java_net_VMPlainSocketImpl_leaveGroup6 (JNIEnv *env, 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; @@ -913,13 +915,13 @@ getif_address (JNIEnv *env, const char *ifname) 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_IFADDRS_H) && defined (HAVE_GETIFADDRS) struct ifaddrs *ifaddrs, *i; char *lastname = NULL; int index = 1; diff --git a/native/jni/java-net/java_net_VMNetworkInterface.c b/native/jni/java-net/java_net_VMNetworkInterface.c index 203f6acd0..b51bf68ec 100644 --- a/native/jni/java-net/java_net_VMNetworkInterface.c +++ b/native/jni/java-net/java_net_VMNetworkInterface.c @@ -41,7 +41,9 @@ exception statement from your version. */ #include <sys/types.h> #include <sys/socket.h> +#ifdef HAVE_IFADDRS_H #include <ifaddrs.h> +#endif #include <netinet/in.h> #include <errno.h> #include <stdlib.h> @@ -111,7 +113,7 @@ free_netif_list (JNIEnv *env, struct netif_entry *list) 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; |