File fixLibNames.patch.in of Package netty-tcnative

--- netty-tcnative-netty-tcnative-parent-1.1.33.Fork26/openssl-dynamic/src/main/java/org/apache/tomcat/jni/Library.java.orig	2020-01-09 11:01:40.309218963 +0100
+++ netty-tcnative-netty-tcnative-parent-1.1.33.Fork26/openssl-dynamic/src/main/java/org/apache/tomcat/jni/Library.java	2020-01-09 11:04:45.202196578 +0100
@@ -26,7 +26,7 @@
 public final class Library {
 
     /* Default library names */
-    private static final String [] NAMES = {"netty-tcnative", "libnetty-tcnative", "netty-tcnative-1", "libnetty-tcnative-1"};
+    private static final String [] NAMES = {"netty-tcnative", "libnetty-tcnative", "netty-tcnative-1", "libnetty-tcnative-1", "tcnative-1", "libtcnative-1"};
     /*
      * A handle to the unique Library singleton instance.
      */
@@ -38,22 +38,20 @@
         String [] paths = path.split(File.pathSeparator);
         StringBuilder err = new StringBuilder();
         for (int i = 0; i < NAMES.length; i++) {
+            String name = "@PATH@/" + NAMES[i] + ".so";
             try {
-                System.loadLibrary(NAMES[i]);
+                System.load(name);
                 loaded = true;
             } catch (ThreadDeath t) {
                 throw t;
             } catch (VirtualMachineError t) {
                 throw t;
             } catch (Throwable t) {
-                String name = System.mapLibraryName(NAMES[i]);
-                for (int j = 0; j < paths.length; j++) {
-                    java.io.File fd = new java.io.File(paths[j] , name);
+                java.io.File fd = new java.io.File(name);
                     if (fd.exists()) {
                         // File exists but failed to load
                         throw new RuntimeException(t);
                     }
-                }
                 if (i > 0) {
                     err.append(", ");
                 }
openSUSE Build Service is sponsored by