JNI initialization fix unixdomainchannels
authormichaelm
Mon, 11 Nov 2019 12:26:07 +0000
branchunixdomainchannels
changeset 59007 27709bf817a5
parent 59004 84e08e00c29c
child 59012 33059b08e2d9
JNI initialization fix
src/java.base/share/native/libnio/ch/UnixDomainSocketAddress.c
src/java.base/unix/native/libnio/ch/InheritedChannel.c
--- a/src/java.base/share/native/libnio/ch/UnixDomainSocketAddress.c	Mon Nov 11 10:39:49 2019 +0000
+++ b/src/java.base/share/native/libnio/ch/UnixDomainSocketAddress.c	Mon Nov 11 12:26:07 2019 +0000
@@ -44,7 +44,7 @@
  * Signature: ()V
  */
 JNIEXPORT void JNICALL
-Java_java_nio_channels_UnixDomainSocketAddress_init(JNIEnv *env, jclass cls) {
+Java_java_nio_channels_UnixDomainSocketAddress_init(JNIEnv *env, jclass dontuse) {
     if (!udsa_initialized) {
         jclass c = (*env)->FindClass(env,"java/nio/channels/UnixDomainSocketAddress");
         CHECK_NULL(c);
--- a/src/java.base/unix/native/libnio/ch/InheritedChannel.c	Mon Nov 11 10:39:49 2019 +0000
+++ b/src/java.base/unix/native/libnio/ch/InheritedChannel.c	Mon Nov 11 12:26:07 2019 +0000
@@ -36,6 +36,7 @@
 #include "net_util.h"
 
 #include "sun_nio_ch_InheritedChannel.h"
+#include "java_nio_channels_UnixDomainSocketAddress.h"
 
 static int matchFamilyInet(SOCKETADDRESS *sa) {
     return (sa->sa.sa_family == (ipv6_available() ? AF_INET6 : AF_INET));
@@ -46,6 +47,8 @@
 {
     /* Initialize InetAddress IDs before later use of NET_XXX functions */
     initInetAddressIDs(env);
+    /* Same for UnixDomainSocketAddress */
+    Java_java_nio_channels_UnixDomainSocketAddress_init(env, NULL);
 }
 
 JNIEXPORT jobject JNICALL