diff options
author | Mark Wielaard <mark@klomp.org> | 2007-06-25 09:44:35 +0000 |
---|---|---|
committer | Mark Wielaard <mark@klomp.org> | 2007-06-25 09:44:35 +0000 |
commit | 38d71ece08e54b4c738f17049a9bb4e84c616b77 (patch) | |
tree | 6760418c50f22f1c7bbe61d721dd17e7856f2aa2 | |
parent | 44a90baeafad37be5995b092a37dea635c617190 (diff) | |
download | classpath-38d71ece08e54b4c738f17049a9bb4e84c616b77.tar.gz |
* native/jni/native-lib/cpnet.c
(cpnet_aton) Moved variable declaration of inet6_addr so it is
actually in the scope of its use.
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | native/jni/native-lib/cpnet.c | 6 |
2 files changed, 11 insertions, 3 deletions
@@ -1,3 +1,9 @@ +2007-06-25 Mark Wielaard <mark@klomp.org> + + * native/jni/native-lib/cpnet.c + (cpnet_aton) Moved variable declaration of inet6_addr so it is + actually in the scope of its use. + 2007-06-25 Dalibor Topic <robilad@kaffe.org> * native/jni/java-net/gnu_java_net_VMPlainSocketImpl.c @@ -28,7 +34,7 @@ code conditionally on IPv6 facilities being available. (cpnet_aton) Moved variable declaration of inet6_addr to the scope of its use. Build IPv6 dependant code conditionally - on IPv6 facilities being available. + on IPv6 facilities being available. * native/jni/native-lib/cpnet.h (cpnet_newIPV6Address, cpnet_isIPV6Address, cpnet_IPV6AddressToBytes, diff --git a/native/jni/native-lib/cpnet.c b/native/jni/native-lib/cpnet.c index 7017fc172..044498113 100644 --- a/native/jni/native-lib/cpnet.c +++ b/native/jni/native-lib/cpnet.c @@ -767,6 +767,10 @@ jint cpnet_aton (JNIEnv *env, const char *hostname, cpnet_address **addr) { jbyte *bytes = NULL; +#if defined(HAVE_INET_PTON) && defined(HAVE_INET6) + jbyte inet6_addr[16]; +#endif + #ifdef HAVE_INET_ATON struct in_addr laddr; if (inet_aton (hostname, &laddr)) @@ -793,8 +797,6 @@ jint cpnet_aton (JNIEnv *env, const char *hostname, cpnet_address **addr) #if defined(HAVE_INET_PTON) && defined(HAVE_INET6) if (inet_pton (AF_INET6, hostname, inet6_addr) > 0) { - jbyte inet6_addr[16]; - *addr = cpnet_newIPV6Address(env); cpnet_bytesToIPV6Address(*addr, inet6_addr); return 0; |