src/jdk.net/solaris/classes/jdk/net/SolarisSocketOptions.java
changeset 55687 065142ace8e9
parent 47216 71c04702a3d5
--- a/src/jdk.net/solaris/classes/jdk/net/SolarisSocketOptions.java	Tue Jul 16 18:05:42 2019 +0300
+++ b/src/jdk.net/solaris/classes/jdk/net/SolarisSocketOptions.java	Tue Jul 16 17:50:54 2019 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
@@ -45,12 +45,16 @@
     private static native void init();
 
     static {
-        AccessController.doPrivileged(new PrivilegedAction<Void>() {
-            public Void run() {
-                System.loadLibrary("extnet");
-                return null;
-            }
-        });
+        if (System.getSecurityManager() == null) {
+            System.loadLibrary("extnet");
+        } else {
+            AccessController.doPrivileged(new PrivilegedAction<Void>() {
+                public Void run() {
+                    System.loadLibrary("extnet");
+                    return null;
+                }
+            });
+        }
         init();
     }
 }