summaryrefslogtreecommitdiff
path: root/lang/openjdk8/patches/patch-jdk_src_solaris_classes_java_lang_UNIXProcess.java.bsd
diff options
context:
space:
mode:
Diffstat (limited to 'lang/openjdk8/patches/patch-jdk_src_solaris_classes_java_lang_UNIXProcess.java.bsd')
-rw-r--r--lang/openjdk8/patches/patch-jdk_src_solaris_classes_java_lang_UNIXProcess.java.bsd46
1 files changed, 46 insertions, 0 deletions
diff --git a/lang/openjdk8/patches/patch-jdk_src_solaris_classes_java_lang_UNIXProcess.java.bsd b/lang/openjdk8/patches/patch-jdk_src_solaris_classes_java_lang_UNIXProcess.java.bsd
new file mode 100644
index 00000000000..3fc2460550d
--- /dev/null
+++ b/lang/openjdk8/patches/patch-jdk_src_solaris_classes_java_lang_UNIXProcess.java.bsd
@@ -0,0 +1,46 @@
+$NetBSD: patch-jdk_src_solaris_classes_java_lang_UNIXProcess.java.bsd,v 1.1 2015/02/08 08:41:25 tnn Exp $
+
+* Under NetBSD 5, use fork instead of posix_spawn. NetBSD 5 has no posix_spawn.
+
+--- jdk/src/solaris/classes/java/lang/UNIXProcess.java.bsd.orig 2015-02-02 15:37:12.000000000 +0000
++++ jdk/src/solaris/classes/java/lang/UNIXProcess.java.bsd
+@@ -95,16 +95,31 @@ final class UNIXProcess extends Process
+ public LaunchMechanism run() {
+ String javahome = System.getProperty("java.home");
+ String osArch = System.getProperty("os.arch");
++ String osname = System.getProperty("os.name");
+
+ helperpath = toCString(javahome + "/lib/" + osArch + "/jspawnhelper");
+- String s = System.getProperty(
+- "jdk.lang.Process.launchMechanism", "posix_spawn");
+-
+- try {
+- return LaunchMechanism.valueOf(s.toUpperCase());
+- } catch (IllegalArgumentException e) {
+- throw new Error(s + " is not a supported " +
+- "process launch mechanism on this platform.");
++/* NetBSD 5 does not have posix_spawn. Use fork instead. */
++ String osversion = System.getProperty("os.version");
++ if (osname.startsWith("NetBSD") && osversion.startsWith("5")) {
++ String s = System.getProperty(
++ "jdk.lang.Process.launchMechanism", "fork");
++
++ try {
++ return LaunchMechanism.valueOf(s.toUpperCase());
++ } catch (IllegalArgumentException e) {
++ throw new Error(s + " is not a supported " +
++ "process launch mechanism on this platform.");
++ }
++ } else {
++ String s = System.getProperty(
++ "jdk.lang.Process.launchMechanism", "posix_spawn");
++
++ try {
++ return LaunchMechanism.valueOf(s.toUpperCase());
++ } catch (IllegalArgumentException e) {
++ throw new Error(s + " is not a supported " +
++ "process launch mechanism on this platform.");
++ }
+ }
+ }
+ });