File: libpcsclite-dlopen.diff

package info (click to toggle)
openjdk-11 11.0.29~4ea-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 780,672 kB
  • sloc: java: 5,208,618; xml: 1,192,267; cpp: 1,138,375; ansic: 461,923; javascript: 162,416; sh: 16,738; objc: 13,729; python: 4,757; asm: 3,570; makefile: 2,970; perl: 357; awk: 351; sed: 172; jsp: 24; csh: 3
file content (36 lines) | stat: -rw-r--r-- 1,334 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
--- a/src/java.smartcardio/unix/classes/sun/security/smartcardio/PlatformPCSC.java
+++ b/src/java.smartcardio/unix/classes/sun/security/smartcardio/PlatformPCSC.java
@@ -48,6 +48,7 @@
 
     private final static String PROP_NAME = "sun.security.smartcardio.library";
 
+    private final static String LIB0 = "libpcsclite.so.1";
     private final static String LIB1 = "/usr/$LIBISA/libpcsclite.so";
     private final static String LIB2 = "/usr/local/$LIBISA/libpcsclite.so";
     private final static String PCSC_FRAMEWORK = "/System/Library/Frameworks/PCSC.framework/Versions/Current/PCSC";
@@ -104,22 +105,9 @@
         if (lib.length() != 0) {
             return lib;
         }
-        lib = expand(LIB1);
-        if (new File(lib).isFile()) {
-            // if LIB1 exists, use that
-            return lib;
-        }
-        lib = expand(LIB2);
-        if (new File(lib).isFile()) {
-            // if LIB2 exists, use that
-            return lib;
-        }
-        lib = PCSC_FRAMEWORK;
-        if (new File(lib).isFile()) {
-            // if PCSC.framework exists, use that
-            return lib;
-        }
-        throw new IOException("No PC/SC library found on this system");
+	// let dlopen do the work
+	lib = LIB0;
+	return lib;
     }
 
     private static native void initialize(String libraryName);