From eb5f920507ffb58564f1fb415132283476b69933 Mon Sep 17 00:00:00 2001 From: Greg Lewis Date: Thu, 17 Oct 2019 22:39:05 +0000 Subject: [PATCH] Fix file interaction * Load libnio in BsdNativeDispatcher, as per other OSes * Export getmntonname0 from libnio PR: 241317 Submitted by: cmt@ --- java/openjdk8/Makefile | 1 + .../patch-jdk-make-mapfiles-libnio-mapfile-bsd | 18 +++++++++++++----- ...classes-sun-nio-fs-BsdNativeDispatcher.java | 14 ++++++++++++++ 3 files changed, 28 insertions(+), 5 deletions(-) create mode 100644 java/openjdk8/files/patch-jdk-src-solaris-classes-sun-nio-fs-BsdNativeDispatcher.java diff --git a/java/openjdk8/Makefile b/java/openjdk8/Makefile index 862d9345ba5a..81fa6ecec6d7 100644 --- a/java/openjdk8/Makefile +++ b/java/openjdk8/Makefile @@ -2,6 +2,7 @@ PORTNAME= openjdk PORTVERSION= ${JDK_MAJOR_VERSION}.${JDK_UPDATE_VERSION}.${JDK_BUILD_NUMBER}.${BSD_JDK_VERSION} +PORTREVISION= 1 CATEGORIES= java devel MASTER_SITES= LOCAL/jkim:jtreg PKGNAMESUFFIX?= ${JDK_MAJOR_VERSION} diff --git a/java/openjdk8/files/patch-jdk-make-mapfiles-libnio-mapfile-bsd b/java/openjdk8/files/patch-jdk-make-mapfiles-libnio-mapfile-bsd index 33a4c0ae0acb..c53a57d2f94a 100644 --- a/java/openjdk8/files/patch-jdk-make-mapfiles-libnio-mapfile-bsd +++ b/java/openjdk8/files/patch-jdk-make-mapfiles-libnio-mapfile-bsd @@ -1,14 +1,22 @@ ---- jdk/make/mapfiles/libnio/mapfile-bsd +--- jdk/make/mapfiles/libnio/mapfile-bsd.orig 2019-10-17 21:15:55 UTC +++ jdk/make/mapfiles/libnio/mapfile-bsd -@@ -42,6 +42,7 @@ SUNWprivate_1.1 { - Java_sun_nio_ch_FileChannelImpl_position0; +@@ -41,6 +41,7 @@ SUNWprivate_1.1 { + Java_sun_nio_ch_FileChannelImpl_map0; Java_sun_nio_ch_FileChannelImpl_transferTo0; Java_sun_nio_ch_FileChannelImpl_unmap0; + Java_sun_nio_ch_FileDispatcherImpl_allocate0; Java_sun_nio_ch_FileDispatcherImpl_close0; Java_sun_nio_ch_FileDispatcherImpl_closeIntFD; - Java_sun_nio_ch_FileDispatcherImpl_force0; -@@ -143,6 +144,14 @@ SUNWprivate_1.1 { + Java_sun_nio_ch_FileDispatcherImpl_seek0; +@@ -135,6 +136,7 @@ SUNWprivate_1.1 { + Java_sun_nio_fs_BsdNativeDispatcher_endfsstat; + Java_sun_nio_fs_BsdNativeDispatcher_fsstatEntry; + Java_sun_nio_fs_BsdNativeDispatcher_getfsstat; ++ Java_sun_nio_fs_BsdNativeDispatcher_getmntonname0; + Java_sun_nio_fs_BsdNativeDispatcher_initIDs; + Java_sun_nio_fs_GnomeFileTypeDetector_initializeGio; + Java_sun_nio_fs_GnomeFileTypeDetector_initializeGnomeVfs; +@@ -143,6 +145,14 @@ SUNWprivate_1.1 { Java_sun_nio_fs_MagicFileTypeDetector_initialize0; Java_sun_nio_fs_MagicFileTypeDetector_probe0; Java_sun_nio_fs_UnixCopyFile_transfer; diff --git a/java/openjdk8/files/patch-jdk-src-solaris-classes-sun-nio-fs-BsdNativeDispatcher.java b/java/openjdk8/files/patch-jdk-src-solaris-classes-sun-nio-fs-BsdNativeDispatcher.java new file mode 100644 index 000000000000..d8de6d6d6d1d --- /dev/null +++ b/java/openjdk8/files/patch-jdk-src-solaris-classes-sun-nio-fs-BsdNativeDispatcher.java @@ -0,0 +1,14 @@ +--- jdk/src/solaris/classes/sun/nio/fs/BsdNativeDispatcher.java.orig 2019-10-17 19:49:41 UTC ++++ jdk/src/solaris/classes/sun/nio/fs/BsdNativeDispatcher.java +@@ -69,6 +69,11 @@ class BsdNativeDispatcher extends UnixNativeDispatcher + private static native void initIDs(); + + static { ++ AccessController.doPrivileged(new PrivilegedAction() { ++ public Void run() { ++ System.loadLibrary("nio"); ++ return null; ++ }}); + initIDs(); + } + }