8232097: (sctp) SctpNet.init() results in java.lang.UnsatisfiedLinkError
authorchegar
Thu, 21 Nov 2019 12:14:28 +0000
changeset 59204 7b10581e9632
parent 59203 696e6a7e3b6a
child 59205 afcc8af048e6
8232097: (sctp) SctpNet.init() results in java.lang.UnsatisfiedLinkError Reviewed-by: alanb
src/jdk.sctp/unix/classes/sun/nio/ch/sctp/SctpMultiChannelImpl.java
src/jdk.sctp/unix/classes/sun/nio/ch/sctp/SctpNet.java
--- a/src/jdk.sctp/unix/classes/sun/nio/ch/sctp/SctpMultiChannelImpl.java	Thu Nov 21 12:14:26 2019 +0000
+++ b/src/jdk.sctp/unix/classes/sun/nio/ch/sctp/SctpMultiChannelImpl.java	Thu Nov 21 12:14:28 2019 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -991,15 +991,4 @@
         return SctpChannelImpl.send0(fd, address, length, addr, port, assocId,
                 streamNumber, unordered, ppid);
     }
-
-    static {
-        IOUtil.load();   /* loads nio & net native libraries */
-        java.security.AccessController.doPrivileged(
-            new java.security.PrivilegedAction<Void>() {
-                public Void run() {
-                    System.loadLibrary("sctp");
-                    return null;
-                }
-            });
-    }
 }
--- a/src/jdk.sctp/unix/classes/sun/nio/ch/sctp/SctpNet.java	Thu Nov 21 12:14:26 2019 +0000
+++ b/src/jdk.sctp/unix/classes/sun/nio/ch/sctp/SctpNet.java	Thu Nov 21 12:14:28 2019 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -335,6 +335,14 @@
     static native void init();
 
     static {
+        IOUtil.load();   // loads nio & net native libraries
+        java.security.AccessController.doPrivileged(
+                new java.security.PrivilegedAction<Void>() {
+                    public Void run() {
+                        System.loadLibrary("sctp");
+                        return null;
+                    }
+                });
         init();
     }
 }