Permalink
Browse files

Bump PKGREVISION. Fix PR pkg/48982.

* Use fork instead of posix_spawn under NetBSD 5.
  • Loading branch information...
1 parent 2f422ca commit ffd75ae9f3ee6964a5e9f39b45dcd3aa5ef4ac9d ryoon committed Jul 21, 2014
View
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.70 2014/06/18 09:28:16 wiz Exp $
+# $NetBSD: Makefile,v 1.71 2014/07/21 00:15:41 ryoon Exp $
DISTNAME= openjdk-1.7.60-20140614
PKGNAME= openjdk7-1.7.60
-PKGREVISION= 1
+PKGREVISION= 2
CATEGORIES= lang
MASTER_SITES= ${MASTER_SITE_LOCAL:=openjdk7/}
EXTRACT_SUFX= .tar.bz2
View
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.49 2014/06/25 13:21:51 obache Exp $
+$NetBSD: distinfo,v 1.50 2014/07/21 00:15:41 ryoon Exp $
SHA1 (openjdk7/UnlimitedJCEPolicyJDK7.zip) = 7d3c9ee89536b82cd21c680088b1bced16017253
RMD160 (openjdk7/UnlimitedJCEPolicyJDK7.zip) = a4a6a284579f43d2df3532d279e143d2f03c2c3f
@@ -155,9 +155,11 @@ SHA1 (patch-jdk_src_share_native_sun_awt_image_jpeg_imageioJPEG.c) = 8502fc7da30
SHA1 (patch-jdk_src_share_native_sun_awt_image_jpeg_jpegdecoder.c) = ca10ce2d79f11925b7ec52fc1b5dfad9b25ddddb
SHA1 (patch-jdk_src_share_native_sun_security_ec_impl_ecc__impl.h) = 13aae05b649af0d1f908b0a9b6f60c55d8baa7d4
SHA1 (patch-jdk_src_solaris_bin_ergo__i586.c) = 7b1d1c7f84e752ef7c53d5419dc3ab5213fec716
+SHA1 (patch-jdk_src_solaris_classes_java_lang_UNIXProcess.java.bsd) = 41edb9389d4900cd35e52bb29df96d474617a372
SHA1 (patch-jdk_src_solaris_classes_sun_net_PortConfig.java) = 265d9f401eff6a39d607c8c8a14ecb56c089ed44
SHA1 (patch-jdk_src_solaris_classes_sun_nio_ch_DefaultAsynchronousChannelProvider.java) = 02e51e702868e1cea4a2628eccbcaa81f231efce
SHA1 (patch-jdk_src_solaris_classes_sun_nio_fs_BsdFileSystemProvider.java) = b57411309b8d46de6a9ab3606d72690908989d50
+SHA1 (patch-jdk_src_solaris_native_java_lang_UNIXProcess__md.c) = 205b724aa91169cfe81217893bc5922e5b47da6f
SHA1 (patch-jdk_src_solaris_native_java_net_NetworkInterface.c) = 63af9eee1f5bbc695a14cab51fa7089eb2a0a04b
SHA1 (patch-jdk_src_solaris_native_java_net_net__util__md.c) = 883fb8cf76f9a6d47e1c96badb07be162add80f7
SHA1 (patch-jdk_src_solaris_native_sun_awt_X11Color.c) = 928e9fbc11d8e64a69e27573efa13482acb62480
@@ -0,0 +1,43 @@
+$NetBSD: patch-jdk_src_solaris_classes_java_lang_UNIXProcess.java.bsd,v 1.1 2014/07/21 00:15:41 ryoon 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 2014-06-14 20:38:31.000000000 +0000
++++ jdk/src/solaris/classes/java/lang/UNIXProcess.java.bsd
+@@ -102,14 +102,28 @@ final class UNIXProcess extends Process
+ helperpath = toCString(javahome + "/lib/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.");
++ }
+ }
+ }
+ });
@@ -0,0 +1,50 @@
+$NetBSD: patch-jdk_src_solaris_native_java_lang_UNIXProcess__md.c,v 1.1 2014/07/21 00:15:41 ryoon Exp $
+
+* NetBSD 5 has no posix_spawn.
+
+--- jdk/src/solaris/native/java/lang/UNIXProcess_md.c.orig 2014-06-14 20:38:31.000000000 +0000
++++ jdk/src/solaris/native/java/lang/UNIXProcess_md.c
+@@ -48,9 +48,15 @@
+ #include <signal.h>
+ #include <string.h>
+
++#if defined(__NetBSD__)
++#include <sys/param.h>
++#endif
++
+ #if defined(__solaris__) || defined(_ALLBSD_SOURCE)
++#if !defined(__NetBSD__) || (__NetBSD_Version__ >= 600000000)
+ #include <spawn.h>
+ #endif
++#endif
+
+ #include "childproc.h"
+
+@@ -460,6 +466,7 @@ forkChild(ChildStuff *c) {
+ }
+
+ #if defined(__solaris__) || defined(_ALLBSD_SOURCE)
++#if !defined(__NetBSD__) || (__NetBSD_Version__ >= 600000000)
+ static pid_t
+ spawnChild(JNIEnv *env, jobject process, ChildStuff *c, const char *helperpath) {
+ pid_t resultPid;
+@@ -543,6 +550,7 @@ spawnChild(JNIEnv *env, jobject process,
+ return resultPid;
+ }
+ #endif
++#endif
+
+ /*
+ * Start a child process running function childProcess.
+@@ -556,9 +564,11 @@ startChild(JNIEnv *env, jobject process,
+ case MODE_FORK:
+ return forkChild(c);
+ #if defined(__solaris__) || defined(_ALLBSD_SOURCE)
++#if !defined(__NetBSD__) || (__NetBSD_Version__ >= 600000000)
+ case MODE_POSIX_SPAWN:
+ return spawnChild(env, process, c, helperpath);
+ #endif
++#endif
+ default:
+ return -1;
+ }

0 comments on commit ffd75ae

Please sign in to comment.