/.diff Secret
Created
April 4, 2019 07:17
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/core/src/main/java/org/jruby/util/io/FilenoUtil.java b/core/src/main/java/org/jruby/util/io/FilenoUtil.java | |
index 573ca51348..87a12b918b 100644 | |
--- a/core/src/main/java/org/jruby/util/io/FilenoUtil.java | |
+++ b/core/src/main/java/org/jruby/util/io/FilenoUtil.java | |
@@ -137,9 +137,10 @@ public class FilenoUtil { | |
selChImpl = Class.forName("sun.nio.ch.SelChImpl"); | |
try { | |
getFD = selChImpl.getMethod("getFD"); | |
- if (!Modules.trySetAccessible(getFD)) { | |
- getFD = null; | |
- } | |
+// if (!Modules.trySetAccessible(getFD)) { | |
+// getFD = null; | |
+// } | |
+ getFD.setAccessible(true); | |
} catch (Exception e) { | |
getFD = null; | |
} | |
@@ -156,9 +157,10 @@ public class FilenoUtil { | |
fileChannelImpl = Class.forName("sun.nio.ch.FileChannelImpl"); | |
try { | |
fd = fileChannelImpl.getDeclaredField("fd"); | |
- if (!Modules.trySetAccessible(fd)) { | |
- fd = null; | |
- } | |
+// if (!Modules.trySetAccessible(fd)) { | |
+// fd = null; | |
+// } | |
+ fd.setAccessible(true); | |
} catch (Exception e) { | |
fd = null; | |
} | |
@@ -172,9 +174,10 @@ public class FilenoUtil { | |
Field ffd; | |
try { | |
ffd = FileDescriptor.class.getDeclaredField("fd"); | |
- if (!Modules.trySetAccessible(ffd)) { | |
- ffd = null; | |
- } | |
+// if (!Modules.trySetAccessible(ffd)) { | |
+// ffd = null; | |
+// } | |
+ ffd.setAccessible(true); | |
} catch (Exception e) { | |
ffd = null; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[] ~/projects/jruby $ JAVA_OPTS="--add-exports java.base/sun.nio.ch=org.jruby.dist" jruby open3_thing/freeze.rb | |
jruby 9.2.7.0-SNAPSHOT (2.5.3) 2019-04-03 705834d OpenJDK 64-Bit Server VM 11.0.2+9 on 11.0.2+9 +jit [darwin-x86_64] | |
{:capture=>"hello, world", :status=>#<Process::Status: pid 7852 exit 0>} | |
[] ~/projects/jruby $ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment